所以在es6中,我可以将属性值传递给具有相同名称的变量,如下所示:
let luke = { occupation: 'jedi', father: 'anakin' }
let {occupation} = luke
console.log(occupation); // 'jedi'
但是如果我想在对象中设置属性的值呢?像这样......
let luke = { occupation: 'jedi', father: 'anakin' }
let someObject = { occupation: null }
我可以使用someObject.occupation = luke.occupation
来完成,但是可以在es6中使用对象破坏吗?