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
In ES6 you can do:
Array(N).fill().map((e,i)=>i+1);
http://jsbin.com/molabiluwa/edit?js,console
Edit: Changed Array(45) to Array(N) since you've updated the question.
Array(45)
Array(N)
console.log( Array(45).fill(0).map((e,i)=>i+1) );