title: Merge duplicate objects in array of objects
body: <p>I have below array of objects,</p>
  
  <pre><code>var data = [
      {
          label: "Book1",
          data: "US edition"
      },
      {
          label: "Book1",
          data: "UK edition"
      },
      {
          label: "Book2",
          data: "CAN edition"
      }
  ];
  </code></pre>
  
  <p>I want to merge the duplicate objects based on attribute 'label' 
  so that Final output will look like below,</p>
  
  <pre><code>var data = [
      {
          label: "Book1",
          data: ["US edition", "UK edition"] //data attribute is merged
      },
      {
          label: "Book2",
          data: "CAN edition"
      }
  ];
  </code></pre>
  
  <p>Can someone help me identify the approach?</p>