create array javascript numbers code example
Example 1: create array javascript numbers
[...Array(5).keys()];
=> [0, 1, 2, 3, 4]
Example 2: create array with number js
var foo = new Array(45); // create an empty array with length 45
Example 3: building an array of a numbers javascript
const arr = [...Array(2)] // output [undefined, undefined]