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
with ES6 you can do:
// `n` is the size you want to initialize your array // `null` is what the array will be filled with (can be any other value) Array(n).fill(null)