I want to create a Map (dictionary) in Javascript where they key is an array of numbers, and the value is some object. I want to retrieve from the map a value previously stored using the same array contents - i.e. if I have an array with some contents I want to retrieve the value (if any) previously stored for an array with the same content.
In most other languages this would be easy. You would override the equality function of the Map so that two arrays with the same content tested equal. This doesn't seem to be available Javascript. Map keys are testing using SameValueZero, which only considers two objects equal if they are the same object.
Is there a way of overriding equality, or is there another standard way of handling this case in Javascript?