title: How do lambda parameters map in TakeWhile?
body: <p>I'm learning LINQ using the <a href="https://code.msdn.microsoft.com/LINQ-Partitioning-Operators-c68aaccc#TakeWhileIndexed" rel="noreferrer">101 LINQ Samples in the MSDN page</a> and I came across this code:</p>
  
  <pre><code>int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
  
  var firstSmallNumbers = numbers.TakeWhile((n, index) =&gt; n &gt;= index);
  
  foreach (var n in firstSmallNumbers)
  {
      Console.WriteLine(n);
  }
  </code></pre>
  
  <p>The purpose of this function is to "use TakeWhile to return elements starting from the beginning of the array until a number is hit that is less than its position in the array."</p>
  
  <p>How exactly the <code>n</code> and <code>index</code> know which parameter to take? (i.e. how does <code>n</code> know it will take <code>5, 4, 1, 3, 9, 8, 6, 7, 2, 0</code> and how does <code>index</code> know it will do an increment of 0, 1, 2, 3...)?</p>