how to create 1-100 in an array code example
Example 1: javascript fill array with range
function range(start, end) {
return Array(end - start + 1).fill().map((_, idx) => start + idx)
}
var result = range(9, 18); // [9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
console.log(result);
Example 2: how to make an array of a value from 1 to the number
[ ...Array(N).keys() ].map( i => i+1);