title: Equivalent of Python's List Comprehension in Javascript
body: <p>Consider the following JSON representation of an array:</p>
  
  <pre><code>logMessages = [
     {
        "timestamp":1499776056977,
        "message":"Log message c7a09226",
        "ingestionTime":1499776058327
     },
     {
        "timestamp":1499777056977,
        "message":"Log message e5d5b51a3ae1",
        "ingestionTime":1499777058327
     },
     {
        "timestamp":1499778056977,
        "message":"Log message b79f4620935b",
        "ingestionTime":1499778058327
     }
  ]
  </code></pre>
  
  <p>Suppose that I'd like to keep only <code>timestamp</code> and <code>message</code> and omit <code>ingestionTime</code>. In Python, I would do:</p>
  
  <pre><code>&gt;&gt;&gt; [ {'timestamp': o['timestamp'], 'message': o['message']} for o in logMessages]
  
  [{'timestamp': 1499776056977, 'message': 'Log message c7a09226'},
   {'timestamp': 1499777056977, 'message': 'Log message e5d5b51a3ae1'}, 
   {'timestamp': 1499778056977, 'message': 'Log message b79f4620935b'}]
  </code></pre>
  
  <p>How do I do the same field filtering in Javascript?</p>