News for hackers. Stuff that matters.
Re:ES6 is beautiful by th0br0 on Thursday April 07, 2016 @03:11PM (#11449776)
Without knowing the type of what you're destructuring though, that's quick to land you in some type of undefined hell.
Re:ES6 is beautiful by btdiehr on Thursday April 07, 2016 @03:21PM (#11449862)
Why wouldn't you know what your destructuring?

`({ id, option = true, name = 'unnamed' }) => // ...`

replaces

``` function(userObject) {

  const id = userObject.id;

  const option = userObject.option || true;

  const name = userObject.name || 'unnamed';

  // ...
} ```

I think this comparison speaks for itself. In pre-es6 code bases you TONS of code that looks like the second.