Skip to content

Comment on ES6 in Depth: Destructuringparent

Comments

That 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.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.