none.equals(none) // true
some(1).equals(none) // false
some(1).equals(some(1)) // true
some(1).equals(some(2)) // false
some({a: 1}).equals(some({a: 1})) // false (different objects)
some(1).equals(some(2), (x, y) => true) // true (custom comparator function)
const jsonCmp = <T>(a: T, b: T): boolean => JSON.stringify(a) === JSON.stringify(b);
some({a: 1}).equals(some({a: 1}), jsonCmp) // true (comparing values converted to JSON)
Is a value of this instance and given
other
instance the same? Default comparator function is===
(referential equality).