destructing obj ...rest code example
Example 1: destructuring assignment
Destructuring assignment is special syntax introduced in ES6,
for neatly assigning values taken directly from an object.
const user = { name: 'John Doe', age: 34 };
const { name, age } = user;
// name = 'John Doe', age = 34
Example 2: array destructuring methods parameters
const items = [ ['foo', 3], ['bar', 9] ];
items.forEach(([word, count]) => {
console.log(word+' '+count);
});