title: How to loop over and array with underscore
body: <p>I'm trying to loop over an Array using Underscore, I have this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var friends = [
    {
      name: 'Jimmy',
      age: 21
    },
    {
      name: 'Anna',
      age: 19
    },
    {
      name: 'Alina',
      age: '22'
    },
    {
      name: 'Carl',
      age: '22'
    }
  ];
  
  var names = _(friends).pluck('name');
  
  for(i = 0; i &lt; friends.length; i++){
    $('ul').append('&lt;li&gt;' + names[i] + '&lt;/li&gt;');
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="http://underscorejs.org/underscore-min.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;ul&gt;&lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm trying to do the same using underscore's each method, but I can't achieve it, I'm trying doing something like this:</p>
  
  <pre><code>_(friends).each(function(namessss, i){
    $('ul').append('&lt;li&gt;' + names[i] + '&lt;/li&gt;');
  });
  </code></pre>
  
  <p>This actually works, but what I don't understand is why?! What's the first parameter for, it doesn't matter what I write there, it works and I wonder how to do this, and why this way works, thanks.</p>