> On 21.7.2015, at 12:42, Claude Pache <[email protected]> wrote: > > For example, one can imagine something like: > > ```js > const {author: {name: {first, last}, birthdate}} = book.toObject() > ```
There are two issues I see here:
- `book.toObject()` would have to do deep conversion and you may not want it.
Let’s say birthdate is immutable map `{day, month, year}`*. This would convert
`birthdate` to `Object` even though you didn’t want that.
- this can handle only String keys. My proposal could be extended so this would
work:
```js
const {[someNonStringKey]: value} = someMap;
```
We already have a syntax for that in es6.
PS: * I know we have `Date()` for that purpose. Just for demonstration.
Samuel
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

