Destructuring Objects in Javascript


Extract properties from objects.

Source Code

let person = {name: 'John', age: 30};
let {name, age} = person;
console.log(name); // "John"
console.log(age); // 30
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments