Is there a more compact way to do this sort of initialization?
for (var i = 0; i < arraySize; i++) array[i] = value;
This is an old question, but I use this in modern JS:
[...new Array(1000000)].map(()=>42);