- Version: all supported versions (oldest tested branch is v4.x (4.8.0))
- Platform: all
- Subsystem: util
In the node REPL, sparse elements of an array are shown as "empty":
However, when one copy the resulting [ , , ] and reenter it into the prompt, a different array is shown, thus confusing the developer:
How the Chrome inspector deals with this situation is explicitly make the inspected result not compliant JS:
>newArray(3)[undefined×3]>[undefined,,undefined]// to differentiate between a hole and `undefined`[undefined,undefined×1,undefined]
Firefox is more upfront:
>newArray(3)Array[<3emptyslots> ]
>[undefined,,undefined]// to differentiate between a hole and `undefined`Array[undefined,<1emptyslot>, undefined ]
In the
nodeREPL, sparse elements of an array are shown as "empty":However, when one copy the resulting
[ , , ]and reenter it into the prompt, a different array is shown, thus confusing the developer:How the Chrome inspector deals with this situation is explicitly make the inspected result not compliant JS:
Firefox is more upfront: