title: How to merge objects with the same properties into a single Array?
body: <p>I'm reciving the next data</p>
  
  <pre><code>    [
        { id: "1", name: "test1", rName: "the1" },
        { id: "1", name: "test1", rName: "the2" },
        { id: "1", name: "test1", rName: "the3" },
        { id: "2", name: "test2", rName: "the1" },
        { id: "2", name: "test2", rName: "the2" },
        { id: "3", name: "test3", rName: "the1" }
      ]
  </code></pre>
  
  <p>I want to merge it by the id and push the rName's into an array to have this structure</p>
  
  <pre><code>    [
        { id: "1", name: "test1", rName: ["the1", "the2","the3"] },
        { id: "2", name: "test2", rName: ["the1", "the2"] },
        { id: "3", name: "test3", rName: ["the1"] }
      ]
  </code></pre>
  
  <p>I thought doing it with reduce but didn't succeed, if anyone can point me to the right direction it will be greatly appreciated.</p>