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