array 0 to 10 code example
Example 1: generate array range
for (i of range(1, 5)) {
console.log(i);
}
/* Output
* 1 2 3 4 5 */
[...range(1, 5)] // [1, 2, 3, 4, 5]
Example 2: how to make an array of a value from 1 to the number
[ ...Array(N).keys() ].map( i => i+1);