I\'m looking for any alternatives to the below for creating a JavaScript array containing 1 through to N where N is only known at runt
1
N
Using ES2015/ES6 spread operator
[...Array(10)].map((_, i) => i + 1)
console.log([...Array(10)].map((_, i) => i + 1))