> Destructuring made it possible to flatten 3-5 lines to 1, along with the
ability to provide defaults.
Yet, as an aside, this "principle" of "flattening" being a sufficient or at
least necessary condition for syntax proposals, is itself not applied
consistently, as seen in the "rejection" (if lack of positive response on
this mailing list can be deemed "rejection") of the proposed
property-picking syntax, which allows one to replace three lines
```
const {a, b} = foo;
const {c, d} = bar;
return {a, b, c, d};
```
with one:
```
return { {a, b} = foo, {c, d} = bar };
```
Actually, by the way, destructuring is of course about more than brevity.
It mitigates a common type of typo-related bug:
```
const misspelledProp = foo.mispeledProp;
```
Bob
On Thu, Jan 25, 2018 at 10:02 AM, Isiah Meadows <[email protected]>
wrote:
> I'm just not convinced it adds anything substantial. Destructuring
> made it possible to flatten 3-5 lines to 1, along with the ability to
> provide defaults. This just:
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss