I'm wondering if it is possible to add JSON as the key value for a map.set.
Adding the JSON as an object works fine:
var theMap = new Map();
var key = {field1 : 'value1', field2: 'value2'};
theMap.set(key, 'foo');
Adding the JSON during the set does not work:
var theMap = new Map();
theMap.set({field1 : 'value1', field2: 'value2'}, 'bar');
Anyone any ideas if something like this is possible?