wiki/content/20201103111746-destructuring_objects.md

477 B

date id title
20201103 b817ea12-eeeb-4723-a90c-f016cdcdb866 Destructuring Objects

Introduction

Destructuring objects introduced in ES6. Rest Operator can also be used here.

Syntax

const saviour = { first: "Jonn", last: "Connor" };
const { f, l } = saviour;

console.log(saviour, f, l); // { first: 'John', last: 'Connor' } John Connor