var foo = new Array(45); // create an empty array with length 45
for(var i,a=[i=0];i<10;a[i++]=i);
const arr = [...Array(2)] // output [undefined, undefined]
var foo = new Array(45); // create an empty array with length 45
for(var i,a=[i=0];i<10;a[i++]=i);
const arr = [...Array(2)] // output [undefined, undefined]