Evaluates the hash code for the specified value
.
Implementations are required to ensure that if equals returns true
for two values x
and y
,
then the value returned by getHashCode for x
must equal the value returned for y
.
Given an aribtrary value, checks whether the value can be compared by the current HashableEqualityComparer.
Provides methods to compare the equality of two objects, along with a function to hash the objects for hash map implementation.
Remarks
Due to the limitation of current JavaScript API, there is no efficient approach to evaluate hash code for every primitive types (e.g.
string
). This can cause significant performance penalty.See
EqualityComparer