linq.Take

Takes a number of elements from the start of the array.

Overloads

  • Array Take (numberToTake)

Array Take (numberToTake)

Takes a number of elements from the start of the array. If not enough elements are available, the entire array is returned.
var myArray = [1, 2, 3, 4];
//Returns [1, 2]
myArray.Take(2);

//Returns [1, 2, 3, 4]
myArray.Take(50);

Last edited Sep 24, 2011 at 8:25 AM by mlorbetske, version 1

Comments

No comments yet.