So in es6, I can pass values of properties to a variable with same name like this:
let luke = { occupation: 'jedi', father: 'anakin' }
let {occupation} = luke
console.log(occupation); // 'jedi'
but what if, I want to set a value of a property inside an object too? Like this...
let luke = { occupation: 'jedi', father: 'anakin' }
let someObject = { occupation: null }
I can simply do it with someObject.occupation = luke.occupation
, but is it possible to do it with object destructing in es6?