@slightlylate *ES spec question: pls forward to the right person if not you!*
According to the spec, what should [...Array(3)] evaluate to?
Node + browsers return [undefined, undefined, undefined], but @typescriptlang compiles to Array(3).slice(), i.e. [ <3 empty items> ]
The order of evaluation is defined, as is the syntax. What does "<3 empty items>" mean if not `[undefined, undefined, undefined]`?
-
-
Array with length 3 but no items (aka 3 "empty slots"). Same as returned by `Array(3)`.
-
slightlyoff:~ > js V8 version... d8> let a = Array(3); undefined d8> a[0] === undefined; true d8> a.length; 3
- 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.