any()

The any linq operator returns whether any of the elements of the collection satisfy the predicate function. If no predicate is given, then the any operator will return true if the collection contains one or more elements. The any operator will throw an exception if the predicate is not a function.
var arr = [1, 2, 3, 4, 5];

// val1 = true
var val1 = $linq(arr).any("x => x > 3");

// val2 = false
var val2 = $linq(arr).any("x => x < 0");

// val3 = true
var val3 = $linq(arr).any();

all()

The all linq operator returns whether all of the elements of the collection satisfy the predicate function. The all operator will throw an exception if the predicate is not given or is not a function.
var arr = [1, 2, 3, 4, 5];

// val1 = true
var val1 = $linq(arr).all("x => x > 0");

// val2 = false
var val2 = $linq(arr).all("x => x > 2"); 

Last edited Nov 12, 2013 at 7:24 AM by battousai999, version 4