title: Setting up an array with jQuery .each() function?
body: <p>I'm trying to set up an array through jQuery's <code>.each()</code> function, but it seems like I'm not properly doing it?</p>
  
  <p>I have attributes in the html such as:</p>
  
  <pre><code>&lt;div class="cheers" data-fname = "fname" data-lname="lname"&gt;some ish..&lt;/div&gt;&lt;!-- going through a while loop!--&gt;
  </code></pre>
  
  <p>Then I have a jquery function that does something like this</p>
  
  <pre><code>var arrayMe = [];
  $(".cheers").each(function(index){
      arrayMe[index] = $(".cheers").attr('data-fname')+","+$(".cheers").attr('data-lname');
  });
  </code></pre>
  
  <p>Then, when I try to do various alerts:</p>
  
  <pre><code>alert(arrayMe); //this gives me the fname,lname
  alert(arrayMe[0]); //this gives me the first fname,lname in the array
  alert(arrayMe[0][1]); //this SUPPOSED to give me the first lname, but it gives me a letter...
  </code></pre>