One short way of doing it would be:
var arr = Array(arraySize).fill(value);
Would make arr = Array [ 0, 0, 0, 0, 0 ] if arraySize == 5 and value == 0, for example.
One short way of doing it would be:
var arr = Array(arraySize).fill(value);
Would make arr = Array [ 0, 0, 0, 0, 0 ] if arraySize == 5 and value == 0, for example.