Is there any restriction on the key type of a Map data structure. Seems like it handles primitive data types like string and number without problem. but it can't somehow locate a key when it's of type of object. I checked it in the REPL and it confirms my assumption. But why it is not mentioned anywhere?
$ node
Welcome to Node.js v12.8.0.
Type ".help" for more information.
> const a = new Map();
undefined
> a.set({a: 1, b: 2}, 3);
Map { { a: 1, b: 2 } => 3 }
> a.get({a: 1, b: 2});
undefined
> const b = new Map();
undefined
> b.set('str', 3);
Map { 'str' => 3 }
> b.get('str');
3
>