Learn JavaScript
Object Destructuring
35.5
Lesson

Nested Destructuring

We can use object destructuring to extract the properties from objects and arrays nested inside an object.

In the example given below, the object person has another object personalInfo nested inside it. We are using the same structure to extract the properties from personalInfo.