Javascript – Is this an intentional design on object destructuring: the assignment result differs as whether the value to be assigned is an object literal or not
I always have such a intuition that an expression inside code can be mentally substituted by its evaluation result. However, the following two code snippets have different execution results. let obj = {}; ({a: obj.b, b: obj.a} = {a: 1,…