There's something VERY wrong with my code: https://ideone.com/pWAzLE
-
-
Replying to @Jack_L_Lance
Are you sure console.log of a list iterates the members? Because nine is the correct number of primes for the list to contain...
1 reply 0 retweets 2 likes -
Replying to @TheRealUpthorn @Jack_L_Lance
The list apparently contains the characters 'n', 'i', 'n', 'e' but I still have not understood how
1 reply 0 retweets 3 likes -
Ok so I don't know JavaScript at all but it seems that the array `candidates` is actually the string "undefined" and then letters are removed until only "nine" remains, very clever
1 reply 0 retweets 7 likes -
On line 5, you declare i but don't give it a value. So i is undefined. On line 8, you add undefined to a list which results in "undefined" being stored in candidates.
2 replies 0 retweets 1 like -
Ah thank you! Do you know why the `composites` get sorted this way: 9,8,4,3,2,16 ? Are they taken alphabetically too?
1 reply 0 retweets 1 like
Yes, by default `Array.prototype.sort` goes lexicographically
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.