> Le 22 mars 2018 à 20:51, Sebastian Malton <[email protected]> a écrit :
>
> Currently object destructoring is only allowed during variable declaration,
> however it would be useful, and seems rather odd from a usage standpoint,
> that it cannot be done during assignment.
>
> Example:
> This is a allowed:
> ```
> const { a } = b;
> ```
>
> But this is not:
> ```
> let a;
>
> if (...) {
> { a } = b.c;
> }
> ```
>
> Sebastian Malton
>
This is already allowed, but you have to use some artefact in order to force
the parser not to interpret`{` as the beginning of a block:
```
let a ;
({ a } = b);
```
—Claude
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss