linq.Count

Gets the number of items in an array

Overloads

  • Number Count ()
  • Number Count (predicate)

Number Count ()

Gets the number of items in an array (equivalent to Array.length)

Example

var myArray = [1,3,5];

//Returns 3
myArray.Count();

Number Count (predicate)

Gets the number of items in an array that satisfy a given condition

Example

var myArray = [1, 2, 3];

//Returns 2
myArray.Count("o => o % 2 == 1");

Last edited Sep 24, 2011 at 11:02 PM by mlorbetske, version 2

Comments

No comments yet.