linq.GroupBy

Groups elements in an array by common key values

Overloads

  • Array GroupBy (keySelector)

Array GroupBy (keySelector)

Groups elements in an array by common key values

Example

var myArray = [{key:1, value:4}, {key:3, value:5}, {key: 1, value 42}];
//Returns:
//[[{key:1, value:4},
//  {key:1, value:42}],
// [{key:3, value:5}]]
myArray.GroupBy("x => x.key");

Last edited Sep 23, 2011 at 6:08 AM by mlorbetske, version 2

Comments

No comments yet.