Comment on ES6 in Depth: DestructuringparentComments−bzbarsky11yThat looks like a typo in the example. This code: var {wtf} = NaN; would set wtf to undefined, for the reasons described in the article, since it would end up doing (NaN)["wtf"]. But trying to destructure NaN into an array should throw an exception.
Comments
That looks like a typo in the example. This code:
would set wtf to undefined, for the reasons described in the article, since it would end up doing (NaN)["wtf"]. But trying to destructure NaN into an array should throw an exception.