title: Finding multiple objects in an array and adding to count value for that object
body: <p>I have been toying with the best way to go about doing this and have found some options but not one that preserves the format I am trying to keep for the array/object.</p>
  
  <p>The overview is I have an array that gets random objects pushed into it and there can be duplicates of the same object, but I want to change it so there is only 1 of each object and instead, having a count property for each object.</p>
  
  <p>An example of what I am working with and what I am aiming to have.</p>
  
  <pre><code>arr = [
    { Name: Item1, Value: 20 },
    { Name: Item2, Value: 20 },
    { Name: Item1, Value: 20 }
  ];
  
  result = [
    { Name: Item1, Value: 20, Count: 2 },
    { Name: Item2, Value: 20, Count: 1 }
  ];
  </code></pre>
  
  <p>As a side note, I am wondering if it better to do this after the array is filled or if it is better to do this while pushing the objects into the array?</p>