where()

The where linq operator returns a new linq object that contains results filtered by a predicate function. The where operator will throw an exception if the predicate is not given or is not a function.
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];

// col1 = [6, 7, 8, 9]
var col1 = $linq(arr).where(function (x) { return x > 5; }).toArray();

// col2 = [1, 2, 3]
var col2 = $linq(arr).where("x => x < 4").toArray();

Last edited Sep 7, 2012 at 5:50 AM by battousai999, version 2