Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Destructuring

// before you would do something like this
const person = {
    name: 'Sara',
    age: 25,
    gender: 'female'    
}

let name = person.name;
let age = person.age;
let gender = person.gender;

console.log(name); // Sara
console.log(age); // 25
console.log(gender); // female
Source by dmitripavlutin.com #
 
PREVIOUS NEXT
Tagged: #JavaScript #Destructuring
ADD COMMENT
Topic
Name
4+9 =