Destructuring

We'll cover the following...

Destructuring is a way for us to extract data from arrays and objects without having to manually create variables. Take this object for example.

Press + to interact
let person = {
name: "Ryan",
age: 30,
location: "Toronto"
};

An example of the destructuring syntax would be this.

Press + to interact
let { age : personAge } = person;
console.log(personAge);

In the destructuring expression the left-hand value is the key from the object, and the right is the new variable we would like to ...