2 ms·
> he is most excited about destructuring `let { name, age, gender } = user;`. Why is this a big deal? Seems pretty trivial.
by Kiro 11y ago
> he is most excited about destructuring `let { name, age, gender } = user;`.
Why is this a big deal? Seems pretty trivial.
- robinson7d 11y agoOne of the reasons that it's a big deal is because of what it means for functions. It helps make named-parameters more attractive, which can help a lot with code maintainability. Example code: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Function_argument_defaults https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... Additionally, it's nice sugar for module loading, for modules that export multiple values.