in the first case you creates an array with undefined pointers.
Array(3)
And the second creates an array with pointers to 3 undefined objects, in this case the pointers them self are NOT undefined, only the objects they point to.
[undefined, undefined, undefined]
when we compare the two case it's look like this
//first case look like this
[undefined, undefined, undefined]
//the second look like this
Array(3) [,,,];
map calls a provided callback function once for each element in an array, in order, and constructs a new array from the results. callback is invoked only for indexes of the array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values. In the first case array values have not explicitly assigned values, whereas in the seconds example were assigned, even if it was the value undefined link
for you example you have to do this
Array(3).fill(undefined).map(x => 'a')