Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

destructuring nested objects

const obj = {a: {b: 'xyz'}};

const {a: {b}} = obj;

console.log(b); // xyz
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #destructuring #nested #objects
ADD COMMENT
Topic
Name
7+3 =