Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

object destructuring example

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

// Object destructuring:
const { realName, address: { city } } = hero;
city; // => 'Gotham'
Source by dmitripavlutin.com #
 
PREVIOUS NEXT
Tagged: #object #destructuring
ADD COMMENT
Topic
Name
5+3 =