Extensible destructuring proposal

Samuel Hapák samuel.hapak at vacuumapps.com
Tue Jul 21 15:11:05 UTC 2015

> On 21.7.2015, at 15:09, Domenic Denicola <d at domenic.me> wrote:
> For maps you can just do
> ```js
> const [[k1, v1], [k2, v2], ...rest] = map.entries();
> ```
> There is no need to add more complexity to object destructuring (which should only be used for objects and their string keys).

Could you please explain it on example?

Let’s say I have

let book = Map{author: {name: “John”, surname: “Doe”}, birthdate: “10-10-1990”};

How would you extract `birthdate`? How would you extract `name`?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3589 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150721/3386965a/attachment-0001.p7s>

More information about the es-discuss mailing list