3 ms·
> It doesn’t actually delete the presence of the index. It actually removes the index. > Object.keys([9,,9]) [ "0", "2" ] The value of the `length` p
by recursive 2y ago
> It doesn’t actually delete the presence of the index.
It actually removes the index.
> Object.keys([9,,9])
[ "0", "2" ]
The value of the `length` property does nothing to imply the presence or lack of any keys. This is covered in the "exotic objects" behavior section in chapter 10 of the ECMAscript spec.
- eyelidlessness 2y agoIt removes the property key. It does not remove the index. You can see the distinction in the iterator produced by the array prototype’s keys method which, per ECMAScript spec chapter 23, yields the array’s indexes. And they are, in fact, determined by the array’s length. You can delete every property corresponding to an array’s indexes, and you’ll get the same result.