3 ms·
But it's worse that that. var foo = new Array(5) That code will make an array with 5 elements, but their values aren't actually null or undefined, but ano
by hajile 5y ago
But it's worse that that.
var foo = new Array(5)
That code will make an array with 5 elements, but their values aren't actually null or undefined, but another kind of "empty" value. You can't access this value directly (it will convert to undefined), but it still exists.
EDIT: there's another kind of undefined that happens within the Temporal Dead Zone too