例如,如果我有两个对象:
var foo = {
x: "bar",
y: "baz"
}
Run Code Online (Sandbox Code Playgroud)
和
var oof = {}
Run Code Online (Sandbox Code Playgroud)
我想将x和y值从foo转移到oof.有没有办法使用es6解构语法?
也许是这样的:
oof{x,y} = foo
Run Code Online (Sandbox Code Playgroud)