Why Array.prototype.map(), Array.prototype.forEach(), and For-In loop give wrong result for Array.fill()? – Javascript
Let say I have an array created by Array.fill() and I want to replace the undefined value with an empty string. These are some of the methods I use: With .map() let data = Array(5).fill(-2, 0, 1).fill(0,2,3).fill(2,4,5); console.log(data); data =…