DEV Community

Discussion on: JavaScript Destructuring | All you need to know

Collapse
 
johncarroll profile image
John Carroll
// you need place the assignment in round brackets
({ prop1: name, prop2: location } = obj); 

^ Worth the read for that bit right there! I always wondered why I ran into issues with assignment using object destructuring.

Collapse
 
midasxiv profile image
Midas/XIV

Yeah, I tried to make it "the" article to refer to when looking up destructuring. And this small little piece is invaluable as I haven't seen it in other articles yet.