Dmitry Soshnikov (2013-08-16T17:47:48.000Z)
domenic at domenicdenicola.com (2013-08-19T05:04:57.490Z)
I think the reasoning here should be through trying to predict the most frequent use-cases. E.g. Erlang which completely based on pattern matching code, throws in this case. But Erlang is a functional with immutable state in its core, so there pattern matching at assignment is exactly the pattern matching (even for simple vars). And destrucuring there is just a consequence of pattern matching. JS assignment is not a matching by its nature, and here the destrucuring is the main part. Especially if to take into account that for years foo.nonExisting returns undefined here. It seems to me that not throwing fits better for JS nature. And for the strict match one could introduce match(...) function which already would throw providing exactly matching procedure first, and then destructuring as a consequence.