Destruction
const obj = {first: ‘adam’, last: ‘cadieux’, age: 45};
instead:
const f = obj.fisrt; const l = obg.last;
const {first:f, last l} obj:
Destruction
const obj = {first: ‘adam’, last: ‘cadieux’, age: 45};
instead:
const f = obj.fisrt; const l = obg.last;
const {first:f, last l} =obj:
or even
const {first:, last } =obj:
Destruction Array
const arr = [‘a’,’b’];
const x =arr[0]; const y =arr[1];
const [x,y] = arr;