skip()

The skip linq operator returns a new linq object that contains all of the elements of the collection after skipping the first "count" number of elements. If "count" is greater than the number of elements in the collection, then an empty collection will be returned.
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

// col1 = [5, 6, 7, 8, 9, 10]
var col1 = $linq(arr).skip(4).toArray();

// col2 = []
var col2 = $linq(arr).skip(100).toArray();

skipWhile()

The skipWhile 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 satisfy the "predicate" function. In other words, elements are skipped from the beginning of the collection until an element does not satisfy the predicate, and then all of the remaining 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).skipWhile("x => x < 5").toArray();

Last edited Sep 10, 2012 at 10:49 PM by battousai999, version 2