title: Make Javascript do List Comprehension
body: <p>What is the cleanest way to make Javascript do something <em>like</em> Python's list comprehension?</p>
  
  <p>In Python if I have a list of objects whose name's I want to 'pull out' I would do this...</p>
  
  <pre><code>list_of_names = [x.name for x in list_of_objects]
  </code></pre>
  
  <p>In javascript I don't really see a more 'beautiful' way of doing that other than just using a for loop construct.</p>
  
  <p>FYI: I'm using jQuery; maybe it has some nifty feature that makes this possible? </p>
  
  <p>More specifically, say I use a jQuery selector like <code>$('input')</code> to get all <code>input</code> elements, how would I <em>most cleanly</em> create an array of all the <code>name</code> attributes for each of these <code>input</code> elements--i.e., all of the <code>$('input').attr('name')</code> strings in an array?</p>