title: JavaScript function argument auto-increments
body: <p>I am building a NodeJS web scraper that has to loop over the data in a table row. I have found that the following two code snippets somehow exhibit the same behavior. In the first scenario how is <code>i</code> getting incremented?</p>
  
  <p>I have searched for auto-incrementing variables or arguments in JavaScript and found nothing so far.</p>
  
  <p>If it matters, this code is inside a request callback, and I am using cheerio to parse the html. </p>
  
  <p>Snippet 1</p>
  
  <pre><code>$(this).find('td span').each(function(i) {
      console.log(i);
  });
  </code></pre>
  
  <p>Snippet 2</p>
  
  <pre><code>$(this).find('td span').each(function(i) {
       console.log(i);
       i++;
  });
  </code></pre>