I am trying to create an array of zeros and I can get the desired result using:
Array.apply(null, Array(9)).map(Number.prototype.valueOf, 0)
but I am wrong if I use:
new Array(9).map(Number.prototype.valueOf, 0)
And in this case, any attempt to match the result of new Array(len) will not be able to return the expected array when matching. Can someone help me understand why this is?
source share