DEV Community

Discussion on: Why Do JS Devs Hate Namespaces?

Collapse
 
michi profile image
Michael Z • Edited

I think most JS devs would define destructing as a "net good". And I'm certainly in that crowd. But some JS devs have come to embrace destructuring to the point that they believe ALL THE THINGS!!! should be destructured.

Wait, are you saying that the following is not clean and pure and beautiful? 😂😂

const { city: { id: cityId } } = { ...user, somethingExtra: '...' }
Enter fullscreen mode Exit fullscreen mode

Never understood why some prefer the above to a classic user.city.id.

Good post!

Collapse
 
bytebodger profile image
Adam Nathaniel Davis

Bingo! I didn't even get into all of the hoops that people sometimes jump through to destructure one choice little bit out of an object, but this is a perfect example.