title: How do you compare two object values in two separate arrays using Javascript (JS)?
body: <p>Lets says I have two arrays that are filled with objects, that have multiple properties, with some keys that are the same.</p>
  
  <pre><code>        var array1 = [
            {name: "Jim", city: 'Toronto', id:'1281732'},
            {name: "Alex", city: 'New York', id:'32423'},
            {name: "Simon", city: 'San Francisco', id:'234234'},
            {name: "Jake", city: 'Milwaukee', id:'1282342341732'}
          ]
  
          var array2 = [
            {name: "Joey", city: 'Raleigh'},
            {name: "Alex", city: 'New York'},
            {name: "Lee", city: 'San Diego'},
            {name: "Jake", city: 'Milwaukee'}
          ]
  </code></pre>
  
  <p>How can I find that the 2nd and 4th object in array1 are also found in array2 by comparing both the name and city. Meaning both object keys must match, and then take the duplicated object from array1 and push into a new array.</p>
  
  <p>Using something like lodash or underscores is acceptable.</p>