DEV Community

Discussion on: JavaScript object destructuring usages you must know

Collapse
 
phyberapex profile image
PhyberApex

Awesome article! I use destruction all the time. Two things I find confusing tho is that nesting and alias share the colon operator (if you look closely they differ in syntax but I find it confusing). Same with default value and assignment to new attribute. So if you want to create a new attribute you need to make sure that one does never already exist on the object or you might get unwanted results.

~Cheers

Collapse
 
atapas profile image
Tapas Adhikary

Thank you! I completly agree.