Answers for "generate numbers from 1 to 100 to array"

2

generate numbers from 1 to 100 to array

var foo = new Array(45); // create an empty array with length 45
Posted by: Guest on December-09-2020
0

generate numbers from 1 to 100 to array

Array.from({length: 5}, (v, k) => k+1); 
// [1,2,3,4,5]
Posted by: Guest on February-09-2021

Code answers related to "generate numbers from 1 to 100 to array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language