Map uses same-value-zero equality for keys, which makes it more difficult
to use reference types like buffers.
HashMap is very similar to Map, but accepts a hash function for keys.
This function should return a primitive, such as a number or string, which
will be used as the key.
It doesn't contain all the functionality of Map because we don't need it,
but it should be fairly easy to update as needed.
Map
uses same-value-zero equality for keys, which makes it more difficult to use reference types like buffers.HashMap
is very similar toMap
, but accepts a hash function for keys. This function should return a primitive, such as a number or string, which will be used as the key.It doesn't contain all the functionality of
Map
because we don't need it, but it should be fairly easy to update as needed.Example