contains()

The contains linq operator returns a boolean value indicating whether the collection contains the given "item". The contains operator also can take a "comparer" function that is used to compare each element of the collection to the given item to test for equality.
var arr1 = [1, 2, 3, 4, 5];

var arr2 = ['blue', 'RED', 'grEEn', 'yellow'];
    
// val1 = true
var val1 = $linq(arr1).contains(3);

// val2 = true
var val2 = $linq(arr2).contains("red", "(x, y) => x.toLowerCase() == y.toLowerCase()");

Last edited Sep 11, 2012 at 7:32 PM by battousai999, version 2