title: Find duplicate object values in an array and merge them - JAVASCRIPT
body: <p>I have an array of objects which contain certain duplicate properties: Following is the array sample:</p>
  
  <pre><code>var jsonData = [{x:12, machine1: 7}, {x:15, machine2:7},{x:12, machine2: 8}];
  </code></pre>
  
  <p>So what i need is to merge the objects with same values of x like the following array:</p>
  
  <pre><code>var jsonData = [{x:12, machine1:7, machine2:8}, {x:15, machine2:7}]
  </code></pre>