Assume `x` has the value `undefined`. What happens with the following?

1) `const a = [...x];`
2) `const o = {...x};`

(No spoilers please. https://abs.twimg.com/emoji/v2/... draggable="false" alt="🙂" title="Leicht lächelndes Gesicht" aria-label="Emoji: Leicht lächelndes Gesicht"> RT& #39;s appreciated!)
I& #39;ll explain when the poll is over. https://abs.twimg.com/emoji/v2/... draggable="false" alt="🙂" title="Leicht lächelndes Gesicht" aria-label="Emoji: Leicht lächelndes Gesicht">
(1/8) Despite an early surge for "Both fail," I& #39;m glad to see that "1 fails, 2 works" got the most votes -- because that& #39;s the right answer. https://abs.twimg.com/emoji/v2/... draggable="false" alt="🙂" title="Leicht lächelndes Gesicht" aria-label="Emoji: Leicht lächelndes Gesicht">

But why? Read on...
(2/8) The fundamental reason is that they& #39;re just different from each other. They do different things. They have different semantics. Were introduced in different specs. I suspect they had different design constraints. They& #39;re similar at a high level, but really quite different.
You can follow @tjcrowder.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: