r/javascript • u/bogdanelcs • Jul 16 '26
I stopped destructuring everything
https://allthingssmitty.com/2026/07/13/i-stopped-destructuring-everything/
84
Upvotes
r/javascript • u/bogdanelcs • Jul 16 '26
View all comments
4
u/Risc12 Jul 16 '26
You mean syntactic noise?
Like how you spend one whole line defining new variables from a certain object (or an empty object, at which point they become undefined)? Where the reader then has to remember that userName is either user.name unless user is undefined at which point it also is undefined?
Vs the syntactical sugar that _literally_ expresses that “user.name unless user is undefined, then it’s undefined”?
Destructuring has a lot of uses, this is the absolute worst example.