Reputation: 55759
In the following code, the object o
is assigned to foo
(after the destructuring).
In other words, the result of the assignment expression ({ bar, bam } = o)
is o
.
const o = { bar: '', bam: '' }
const foo = ({ bar, bam } = o)
console.log(foo === o) // true
Is the result of an assignment expression always the value of the expression on the right-hand side?
Upvotes: 2
Views: 59