DEV Community

Cover image for A Guide to Object Destructuring in JavaScript

A Guide to Object Destructuring in JavaScript

Adriana DiPietro on August 06, 2021

Object Destructuring Object destructuring is an approach to access an object's properties. We use object destructuring because it dries ...
Collapse
 
jivkojelev91 profile image
JivkoJelev91

For nested objects i still prefer the first way:

const { location } = person.previousJob;
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ali_hassan_313 profile image
Ali Hassan

Great

Collapse
 
am20dipi profile image
Adriana DiPietro

Thanks for the comment!

Collapse
 
imiahazel profile image
Imia Hazel

Thanks for the guide.

Collapse
 
am20dipi profile image
Adriana DiPietro

Thank you for reading along!

Collapse
 
keyurparalkar profile image
Keyur Paralkar

The nested object destructing was preety neat. Thanks

Collapse
 
am20dipi profile image
Adriana DiPietro

Thanks for the reply!

Collapse
 
alvinpeter9 profile image
alvinpeter9

Nice read. I was thinking about this a while ago and voilà!, your post came up and I now understand it better.

Collapse
 
am20dipi profile image
Adriana DiPietro

I am glad I could help. Thanks for the reply :)

Collapse
 
ficazzo profile image
Femi Obadimu

Nice Article
You really spliced it....
Anyone could read and understand this...

Collapse
 
am20dipi profile image
Adriana DiPietro

Thanks Femi!

Collapse
 
lucianoricardo737 profile image
Luciano

I like the last. Ty.

Collapse
 
am20dipi profile image
Adriana DiPietro

Thank you for the feedback!