使用解构赋值语法是否可以将数据对象提取到另一个对象中,而不是单独的变量?
Example which produce distinct variables (foo, bar):
var {p: foo, q: bar} = {p: 42, q: true};
console.log(foo); // 42
console.log(bar); // true
我需要创建一个新的对象,其中包含以下属性:
var n = {
foo: 42,
bar: true
}