mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 13:06:22 +00:00
462 B
462 B
id | title |
---|---|
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