skipUntil()

The skipUntil linq operator returns a new linq object that contains all of the elements of the collection after skipping the largest set of elements at the beginning of the collection that fail to satisfy the "predicate" function. In other words, elements are skipped from the beginning of the collection until an element satisfies the predicate, and then that element (that satisfies the predicate) and all of the following elements are returned.
var arr = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5];

// col = [5, 1, 2, 3, 4, 5]
var col = $linq(arr).skipUntil("x => x > 4").toArray();

takeUntil()

The takeUntil linq operator returns a new linq object that contains the largest set of elements taken from the beginning of the collection that do not satisfy the given "predicate". In other words, elements are chosen from the beginning of the collection until an element is encountered that satisfies the predicate.
var arr = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5];

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

Last edited Sep 20, 2012 at 5:04 PM by battousai999, version 1