I was looking at this answer and I've stumbled upon the need of Array.apply to fill array:
var array = Array.apply(null, Array(5)).map(function() { return 0; });
I've checked and this won't actually work:
var array = Array(5).map(function() { return 0; });
I know i could do
var array = Array(5).fill(0);
to obtain same result as the first method, I'm just wondering why it needs Array.apply with null as parameter.