Answers for "destructuring assignment in es6."

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

Destructing variable assignment

let profile = ['bob', 34, 'carpenter'];let [name, age, job] = profile;console.log(name);--> 'bob'
Posted by: Guest on July-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language