Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

object destructuring ES6

const person = {
    name: 'John',
    age: 34,
    hobbies: {
        read: true,
        playGames: true
    }
}
 
let {name, hobbies: {read, playGames}} = person;

console.log(person);
console.log(name);
console.log(read,playGames);
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #object #destructuring
ADD COMMENT
Topic
Name
2+7 =