title: jquery .each function and passing variables
body: <p>I want to loop through a set of <code>&lt;a&gt;</code>'s in an unordered list.</p>
  
  <p>In jQuery, I'd do it this way:</p>
  
  <pre><code>$("#list ul li a").each(function (x) {
   // Do Stuff
  });
  </code></pre>
  
  <p>It's probably a simple question, but how do I pass a variable through as that <code>id</code> shown in the function there?  I'd imagine it is something like:</p>
  
  <pre><code>  var myVar = 'foo';
     $("#list ul li a").each(myVar, function (x) {
       // Do Stuff
       console.log(x);
      });
  </code></pre>
  
  <p>Console out: <code>foo</code>.</p>
  
  <p>But that doesnt seem to work, how do I do this?</p>