-
-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Not entirely sure how this should be handled, but JS Arrays support “holes”, where [1,,3]
creates an array without anything at index 1
. From the outside, that index appears to contain undefined
, but array methods like map
and forEach
skip over those indices while iterating, and flat
removes them, changing the indices of everything that comes after the hole. You can tell the difference between a hole and an undefined
value with either index in array
or array.hasOwnProperty(index)
.
I think it’s perfectly fine to simply say that holes are not handled properly since they’re quite rare in practice but I wanted to make sure this language quirk wasn’t missed.
Originally posted by @j-f1 in #38 (comment)
j-f1
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request