Returns a value as predicate.
A predicate has the following structure:
function (x) : boolean;
Examples
// returns (true)
var predicate1 = Enumerable.toPredicateSafe();
// from Lambda
var predicate2 = Enumerable.toPredicateSafe('x => x != 2');
// from function
var predicate3 = Enumerable.toPredicateSafe(function(x) {
return x != 2;
});
// THROWS EXCEPTION
Enumerable.toPredicateSafe('test');