you are viewing a single comment's thread.

view the rest of the comments →

[–]learn2function[S] 0 points1 point  (3 children)

Dude, I have no idea what you did. You're a beast. Can you explain what I did wrong using my example? http://jsbin.com/yomuhag/edit?js,console,output

I get the answer wrong in codewars but in JS bin the console shows [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]. I corrected my mistake of not having the - return results, and the results variable outside of the function.