title: How to implement lodash-like shallow comparison of objects?
body: <p><a href="https://lodash.com/docs#find" rel="nofollow"><code>_.find(collection, [predicate=_.identity], [fromIndex=0])</code></a> uses <code>predicate=_.identity</code> to match objects in a collection, e.g.</p>
  
  <pre><code>&gt; _.find([{a: 'A', n: 0}, {a: 'A', n: 0}], {a: 'A'})
  &lt; Object {a: "A", n: 0}
  </code></pre>
  
  <p>What is the actual function used to perform a comparison?</p>
  
  <p>e.g. I want to check if specific object (e.g. <code>{a: 'A', n: 0}</code>) matches my predicate <code>{a: 'A'}</code>.</p>
  
  <p>A simple workaround is creating an auxiliary array and using it to write a condition, e.g. <code>!!_.find([{a: 'A', n: 0}], {a: 'A'})</code>. Though there mush a function to perform anequivalent comparison.</p>