I experimented with ES6 Map in io.js and realized that I could not do the following:
var map = new Map()
map.set( {key:"value"}, "some string");
map.get( {key:"value"} );
This is because {key: "value"} === {key: "value"} is false.
I need to be able to use the object as a key, but not require the ACTUAL object to look up a value, for example, how java HashMap uses hashcode and equals. Is it possible?
source
share