Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js object destructuring

const hero = {  
  name: 'Batman',  
  realName: 'Bruce Wayne'
};

const { name, realName } = hero;

name;     // => 'Batman',
realName; // => 'Bruce Wayne'
Source by dmitripavlutin.com #
 
PREVIOUS NEXT
Tagged: #js #object #destructuring
ADD COMMENT
Topic
Name
9+9 =