linq.SelectMany

Projects each element of a sequence to an Array and flattens the resulting sequences.

Overloads

  • Array SelectMany (selector)

Array SelectMany (selector)

Projects each element of a sequence to an Array and flattens the resulting sequences.

Example

var myArray = [[5, 3], [2, 1, 7], [23]];
//Returns [5, 3, 2, 1, 7, 23]
myArray.SelectMany("o => o");

myArray = [[{x: 1}, {x: 3}], [{x: 4}, {x: 4}, {x: 4}], [{x: 5}]];
//Returns [1, 3, 4, 4, 4, 5]
result = myArray.SelectMany("o => o.x");

Last edited Sep 24, 2011 at 6:54 AM by mlorbetske, version 2

Comments

No comments yet.