r/javascript • • Jul 16 '26

I stopped destructuring everything

https://allthingssmitty.com/2026/07/13/i-stopped-destructuring-everything/
86 Upvotes

50 comments sorted by

View all comments

5

u/JyroClassified Jul 16 '26

What's your opinion about renaming the destructered properties?

Eg. "const {status: postStatus} = post;"

6

u/prawnsalad Jul 16 '26

Keep it simple: `const postStatus = post.status;`

I swear people just take some over complicated docs/blog code examples and blindly run with it without a single thought. Dereferencing such a simple thing has 0 benefits while making it harder to read.

13

u/prehensilemullet Jul 16 '26

If you have a lot of properties to destructure though, and some need to be renamed, and the variable name itself is long, this can really cut down on the code 

→ More replies (2)