title: Best way to merge objects using key in an array?
body: <p>What the best way to merge objects in an array using a key?</p>
  <pre><code>[
     {
        &quot;refr&quot;: &quot;https://example.com/&quot;,
        &quot;transactions&quot;: 1
     },
     {
        &quot;refr&quot;: null,
        &quot;pageviews&quot;: 1
     },
     {
        &quot;refr&quot;: &quot;https://example.com/&quot;,
        &quot;pageviews&quot;: 1
     }
  ]
  </code></pre>
  <p>Desired Result using 'refr' key:</p>
  <pre><code>[
     {
        &quot;refr&quot;: &quot;https://example.com/&quot;,
        &quot;transactions&quot;: 1,
        &quot;pageviews&quot;: 1
     },
     {
        &quot;refr&quot;: null,
        &quot;pageviews&quot;: 1
     },   
  ]
  
  </code></pre>
  <p>I am looking for a solution that does NOT use any third party tools, like lodash.</p>