let a = [ [ [ 123 ], ""], [ [ 456 ], ""] ]; let b = [ [ [ 123 ], "a"] ]; Object.assign(, a, b); // There will be [ [ [ 123 ], 'a' ], [ [ 456 ], '' ] ]
It seems that JS engine treated
[ 123 ] as key and
'a' as value.
So I study on the 2022 specification:
126.96.36.199 Object.assign ( target, ...sources ) 1.3.a.iii.1. Let desc be ? from.[GetOwnProperty]. (if desc is undefined, the object doesn't have the property)
10.1.5.1 OrdinaryGetOwnProperty ( O, P ) 2. If O does not have an own property with key P, return undefined.
(If I am doing this right)The specification doesn't tell the detail about judging whether "O does have an own property with key P".
Does this depend on the implementation of ECMAScript engine?
Thanks for your time.