title: Lodash: Loop through array of objects and compare with key/value
body: <p>I am looping through an array of objects and checking to see if the id in each object is contained in an object of key/value pairs. If the id is contained in the key value pairs, then I am assigning the value as a new object property.</p>
  
  <p>So let's say I have an array of objects:</p>
  
  <pre><code>var arrayOfObjects = [
    {
      id: 1,
      name: "bob"
    },
   {
      id: 2,
      name: "sue"
    }
  ];
  </code></pre>
  
  <p>And I also have an object of key value pairs:</p>
  
  <pre><code>var keyValuePairs = { 1: "admin", 2: "user" }
  </code></pre>
  
  <p>I want to loop through my arrayOfObjects, and see if the id is in my keyValuePairs. If so, I want to add a new property to my arrayOfObjects to make it look like this: </p>
  
  <pre><code>var arrayOfObjects = [
    {
      id: 1,
      name: "bob",
      title: "admin"
    },
   {
      id: 2,
      name: "sue",
      title: "user"
    }
  ];
  </code></pre>
  
  <p>I've tried this, but it is not adding the 'title' property to my arrayOfObjects. Any thoughts on how I can do this using lodash?</p>
  
  <pre><code>return _.map(arrayOfObjects, function(obj) {
     if(obj.id in keyValuePairs)
     {
       obj.title = keyValuePairs[obj.id]; 
     }
     return obj;
   });
  </code></pre>