title: How to combine _.map and _.filter in a more efficient way?
body: <p>I am using Lodash in my Angular project and I was wondering if there is a better way to write the following code:</p>
  
  <pre><code>$scope.new_arr = _.map(arr1, function(item){
      return _.assign(item, {new_id: _.find(arr2, {id: item.id})});
    });
  $scope.new_arr = _.filter($scope.new_arr, function (item) {
    return item.new_id !== undefined;
  });
  </code></pre>
  
  <p>I am trying to combine values from one array to same objects in other array, and I want to ignore the objects that not appear in both arrays (it is something like join or left outer join in the sql language).</p>
  
  <p>Here is a fiddle with an example of this code: <a href="https://jsfiddle.net/Hodor_/wcdgczgz/" rel="noreferrer">Click me!</a></p>