解构赋值
object destructuring
let {a, b = 'b'} = {a: 'a'}let node = {
type: "Identifier",
name: "foo"
};
let { type: localType, name: localName } = node;let node = {
type: "Identifier"
};
let { type: localType, name: localName = "bar" } = node;const obj = {name: null, age: false, fullname: undefined} const {name = 'xiaohesong', age = 18, fullname = 'xiaohesong'} = obj
array destructuring
object and array destructuting
function default params destructuring
Last updated