mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 04:56:23 +00:00
479 B
479 B
date | id | title |
---|---|---|
2020-11-03 | 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