Skip to main content
Rollback to Revision 7 - Edit approval overridden by post owner or moderator
Source Link

Simply, this worked for me:

[...Array(5)].map((_, i) => i + 1...); 

Simply, this worked for me:

[...Array(5)].map((_, i) => i + 1); 

Simply, this worked for me:

[...Array(5)].map(...) 
The provided answer does not accurately answer the original question. It only gives half the implementation without filling in the rest.
Source Link

Simply, this worked for me:

[...Array(5)].map(...(_, i) => i + 1); 

Simply, this worked for me:

[...Array(5)].map(...) 

Simply, this worked for me:

[...Array(5)].map((_, i) => i + 1); 
return to simple example not bloated!
Source Link

This works if you want count starting from 0Simply, this worked for me:

[...Array(5)].map((x,i)=>i...); 

If you want to start the count from 1, use below code:

[...Array(5)].map((x,i)=>i+1); 

This works if you want count starting from 0:

[...Array(5)].map((x,i)=>i); 

If you want to start the count from 1, use below code:

[...Array(5)].map((x,i)=>i+1); 

Simply, this worked for me:

[...Array(5)].map(...) 
Completed code and added additional instructions
Source Link
Vaulstein
  • 22.4k
  • 9
  • 58
  • 78
Loading
Remove confusing checkbox
Source Link
cgatian
  • 23.1k
  • 9
  • 60
  • 77
Loading
deleted 4 characters in body
Source Link
Loading
added 2 characters in body
Source Link
Loading
added 2 characters in body
Source Link
Loading
Source Link
Loading