There are more ways. Examples:
new Array(1000).fill(0).map((_, i) => i + 1); [...new Array(1000)].map((_, i) => i + 1);
Also one more Note:
const numbers = Array.from( {length: 1000}, (item, index) => item = index + 1 );
This make no sense because you're mutating value (item) that is throw away. use (_, index) => index + 1
(_, index) => index + 1
I think this is only another article written by someone only to show that he have written one.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There are more ways. Examples:
Also one more Note:
This make no sense because you're mutating value (item) that is throw away. use
(_, index) => index + 1
I think this is only another article written by someone only to show that he have written one.