let { baz } = { foo: ‘aaa‘, bar: ‘bbb‘ };
console.log(baz) // undefined
let obj = { first: ‘hello‘, last: ‘world‘ };
let { first: f, last: l } = obj;
console.log(f) // ‘hello‘
console.log(l) // ‘world‘
var { x: yy = 3 } = {};
var { x: y = 3 } = { x: 5 };
console.log(yy) // 3
console.log(y) // 5
原文:https://www.cnblogs.com/blogZhao/p/12553607.html