title: Map and filter an array at the same time
body: <p>I have an array of objects that I want to iterate over to produce a new filtered array. But also, I need to filter out some of the objects from the new array depending of a parameter. I'm trying this:</p>
  
  <pre><code>function renderOptions(options) {
      return options.map(function (option) {
          if (!option.assigned) {
              return (someNewObject);
          }
      });   
  }
  </code></pre>
  
  <p>Is that a good approach? Is there a better method? I'm open to use any library such as lodash.</p>