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 ES6
const generateArray = n => [...Array(n)].map((_, index) => index + 1);