title: How to use lodash to find and return an object from Array?
body: <p>My objects: </p>
  
  <pre><code>[
      {
          description: 'object1', id: 1
      },
      {
          description: 'object2', id: 2
      }
      {
          description: 'object3', id: 3
      }
      {
          description: 'object4', id: 4
      }
  ]
  </code></pre>
  
  <p>In my function below I'm passing in the description to find the matching ID:</p>
  
  <pre><code>function pluckSavedView(action, view) {
      console.log('action: ', action);
      console.log('pluckSavedView: ', view);  // view = 'object1'
  
      var savedViews = retrieveSavedViews();
      console.log('savedViews: ', savedViews);
  
      if (action === 'delete') {
          var delete_id = _.result(_.find(savedViews, function(description) {
              return description === view;
          }), 'id');
  
          console.log('delete_id: ', delete_id); // should be '1', but is undefined
      }
  }
  </code></pre>
  
  <p>I'm trying to use lodash's find method: <a href="https://lodash.com/docs#find" rel="noreferrer">https://lodash.com/docs#find</a></p>
  
  <p>However my variable <code>delete_id</code> is coming out undefined.</p>
  
  <hr>
  
  <p><strong>Update</strong> for people checking this question out, Ramda is a nice library to do the same thing lodash does, but in a more functional programming way :) 
  <a href="http://ramdajs.com/0.21.0/docs/" rel="noreferrer">http://ramdajs.com/0.21.0/docs/</a></p>