title: Better way to create arrays in javascript?
body: <p>I'm trying to create an array in Javascript with a size that is equivalent to the number of times a certain class is found in the DOM, and then iterate through it to grab the text from an input field present in that class.  I can easily do this like so:</p>
  
  <pre><code>var count = 0;
  $('.className').each(function() {
      count++;
  });
  var classes = new Array(count);
  count = 0;
  $('.className input[type=text]').each(function() {
      classes[count++] = $(this).val();
  });
  </code></pre>
  
  <p>This looks like a lot of code for what seems to be a relatively simple task.  Is there a more efficient or less lengthy way of doing this?</p>
  
  <p>Thanks</p>