Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

object destructuring ES6

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

let { name : name1, age: age1, gender:gender1 } = person;

console.log(name1, age1, gender1);
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #object #destructuring
ADD COMMENT
Topic
Name
7+9 =