Let's say I create a Map object and set some keys to values and end up with something like this:
{"a" => 1, "b" => "hello", 3 => {"c": true}, {a: 1} => "hi"};
I can access the "a", "b", and 3 keys by using myMap.get("a")
, myMap.get("b")
, and myMap.get(3)
respectively, but I can't seem to do myMap.get({a:1})
. This probably has to do with the fact that objects are passed by reference.
How do I access the value of keys that are objects using the Map API?