Answers for "js destructure an object"

0

object destructuring example

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

// Object destructuring:
const { realName, address: { city } } = hero;
city; // => 'Gotham'
Posted by: Guest on February-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language