title: JS: Array.map don't add to array
body: <p>I have some data I'd like to transform using <code>Array.prototype.map</code>. However in the map function there is a chance of an error being thrown by an external function call.  I'd like to catch this error and not add that particular object to the returned array.  Currently I'm just returning undefined and then using <code>Array.prototype.filter</code> to clear out the undefined values, but this seems like a dirty way to do it.</p>
  
  <p>To clarify, I'm looking for this functionality:</p>
  
  <pre><code>['apple','pear','banana', 'peach'].map(function(fruit){
       if (fruit === 'apple') {
           return undefined;
       }
       return 'I love to eat ' + fruit;
  });
  // ['I love to eat pear', 'I love to eat peach', 'I love to eat banana']
  </code></pre>
  
  <p>Any existing implementatons of this? Am I just going about this the wrong way?</p>