mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 03:26:22 +00:00
477 B
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