Extensible destructuring proposal
d at domenic.me
Tue Jul 21 16:12:42 UTC 2015
Well, the spec says they are ordered, so I'm not sure where you're getting that from.
From: Bergi <a.d.bergi at web.de>
Sent: Jul 21, 2015 8:53 AM
To: Domenic Denicola; es-discuss
Subject: Re: Extensible destructuring proposal
Domenic Denicola schrieb:
> For maps you can just do
> const [[k1, v1], [k2, v2], ...rest] = map.entries();
The problem with this is that you would need to know the order of the
keys in the map. Your code does only extract the "first" and "second"
key-value pairs, allowing us to get the key values of them, but this
syntax does not allow us to extract the value for a given key from
somewhere in the map.
Predictability is all fine, but I still consider maps to be inherently
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss