title: Fastest way to compare 2 objects in js
body: <p>Which is the fastest way to compare 2 objects in javascript?</p>
  <p>For example I have these 2 objects:</p>
  <pre><code>a = [{'name': 'john', 'age': 22}, {'name': 'mike', 'age': 23}, {'name': 'anne', 'age': 12}, {'name': 'dan', 'age': 29}, {'name': 'jane', 'age': 34}]
  b = [{'name': 'john', 'age': 22}, {'name': 'anne', 'age': 12}]
  </code></pre>
  <p>Normally, I would do this:</p>
  <pre><code>for (var i = 0; i &lt; a.length; i++) {
      for (var j = 0; j &lt; b.length; j++) {
          console.log(a[i]) // =&gt; [{'name': 'john', 'age': 22}, {'name': 'anne', 'age': 12}]
      }
  }
  </code></pre>
  <p>This is taking too long, is it there another way faster? Thank you for your time!</p>