linq.LongCount

Gets the number of items in an array
Note: Since there is no distinction between int and long in JavaScript, this method is identical to Count

Overloads

  • Number LongCount ()
  • Number LongCount (predicate)

Number LongCount ()

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

Example

var myArray = [1,3,5];

//Returns 3
myArray.LongCount();

Number LongCount (predicate)

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

Example

var myArray = [1, 2, 3];

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

Last edited Sep 24, 2011 at 11:03 PM by mlorbetske, version 1

Comments

No comments yet.