ES6 - Objects

destructuring assignment.

by Rodwyn Moreno

Babel + JSX

let wizard = {magical: true, power: 10};
let { magical, power } = wizard;
console.log(magical, power);

let isWorking = true;
let salary = 90000;

let employee = { isWorking: false, salary:0 };
({ isWorking, salary } = employee);
console.log(isWorking, salary);