Returns a value as equality comparer.
An equality comparer has the following structure:
function (x, y) : boolean
Examples
// x == y
var comparer1 = Enumerable.toEqualityComparerSafe();
// from Lambda
var comparer2 = Enumerable.toEqualityComparerSafe('(x, y) => x === y');
// from function
var comparer3 = Enumerable.toEqualityComparerSafe(function(x, y) {
return x === y;
});
// same as: x === y
var comparer4 = Enumerable.toEqualityComparerSafe(true);
// THROWS EXCEPTION
Enumerable.toEqualityComparerSafe('test');