Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nested destructuring javascript

const a = {
  id: 1,
  name: 'Yogesh',
  age: 30,
  education: {
    degree: 'Bachelor'
  }
};
const {education: {degree}} = a;
console.log(degree); //prints: Bachelor
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #nested #destructuring #javascript
ADD COMMENT
Topic
Name
9+6 =