Help with this Lamda Expression
Hi,
I am learning Lamda Expressions and I find it hard to understand the below expression. Can some one please explain. I took it from msdn.
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
var firstSmallNumbers = numbers.TakeWhile((n, index) => n >= index);
As per my understanding the above expression is trying to get all the numbers whose value >= its position. So the output should be(values): 5,4,3,9,8,7 and index(0,1,3,4,5,6,7)
But the original output is 5,4
Appreicate your help.
Thanks.
Aravind