title: Get unique values and their amounts from an array of objects
body: <p>So I get a JSON request that sends an array of objects with two properties, I need to extract the unique values and their quantities.</p>
  
  <p>This is the JSON that is being sent via Postman:</p>
  
  <pre><code>[
      {"name": "First value", "amount": 2},
      {"name": "Second value", "amount": 4},
      {"name": "First value", "amount": 6}  
  ]
  </code></pre>
  
  <p>I need to return a JSON response with the unique values and their totals added up:</p>
  
  <p>The object should look like this:</p>
  
  <pre><code>{
     "First value": 8,
     "Second value": 4
  }
  </code></pre>