Answers for "ES6 object destructuring syntax"

1

js object destructuring

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

const { name, realName } = hero;

name;     // => 'Batman',
realName; // => 'Bruce Wayne'
Posted by: Guest on October-09-2021
1

Object destructuring

Object Destructuring =>
//
   The destructuring assignment syntax is a JavaScript expression that makes it
possible to unpack values from arrays,
or properties from objects, into distinct variables.
//
example:
const user = {
    id: 42,
    is_verified: true
};

const {id, is_verified} = user;

console.log(id); // 42
console.log(is_verified); // true
Posted by: Guest on September-20-2020
0

js-destructuring

const getTemperature = ({ celsius = 15 } = {}) => celsius;
Posted by: Guest on September-30-2021

Code answers related to "Objective-C"

Browse Popular Code Answers by Language