3 ms·
JS allows arbitrary values (including objects/references) as keys in Maps, but not in objects, there it is cast to string by default (e.g. "object [Object]", "n
by moritzwarhier 3y ago
JS allows arbitrary values (including objects/references) as keys in Maps, but not in objects, there it is cast to string by default (e.g. "object [Object]", "null" or "undefined", this is not intended usage of course).
The symbol primitive is also allowed as an object key, using square bracket access.
And arrays are "exotic objects" that have some special behaviors around their keys (auto-updating length property)