Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • isn't this 0-10? [...Array(10).keys()] Commented May 25, 2016 at 18:19
  • Webstorm suggests (new Array(10)).keys(), is it right? Commented Jul 15, 2016 at 9:09
  • (new Array(10)).keys() , returns ArrayIterator {} , not the array Commented Jul 15, 2016 at 19:34
  • This creates a global variable a. The loop should be for(var a=[];n--;a[n]=n+1) Commented Aug 4, 2016 at 17:09
  • you missed the Code golf(competition to solve a particular problem in the fewest bytes of source code) part in the answer :) Commented Aug 4, 2016 at 17:33