Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

object destructuring ES6

let person = {
    name: 'John',
    age: 21,
    gender: 'male'
}

let { name, age, gender } = person;

console.log(name, age, gender);
Source by dmitripavlutin.com #
 
PREVIOUS NEXT
Tagged: #object #destructuring
ADD COMMENT
Topic
Name
1+5 =