title: Find the total number of counts in array of objects
body: <p>Include how many of the potential voters were in the ages 18-25, how many from 26-35, how many from 36-55, and how many of each of those age ranges actually voted. The resulting object containing this data should have 6 properties.</p>
  
  <pre><code>var voters = [
      {name:'Bob' , age: 30, voted: true},
      {name:'Jake' , age: 32, voted: true},
      {name:'Kate' , age: 25, voted: false},
      {name:'Sam' , age: 20, voted: false},
      {name:'Phil' , age: 21, voted: true},
      {name:'Ed' , age:55, voted:true},
      {name:'Tami' , age: 54, voted:true},
      {name: 'Mary', age: 31, voted: false},
      {name: 'Becky', age: 43, voted: false},
      {name: 'Joey', age: 41, voted: true},
      {name: 'Jeff', age: 30, voted: true},
      {name: 'Zack', age: 19, voted: false}
  ];
  
  function voterResults(arr) {
     // your code here
  }
  
  console.log(voterResults(voters)); // Returned value shown below:
  /*
  { youngVotes: 1,
    youth: 4,
    midVotes: 3,
    mids: 4,
    oldVotes: 3,
    olds: 4 
  }
  </code></pre>
  
  <p>I am being trying out this specific problem, below is what I have tried, where i am able to form the hashmap. But not sure how I can solve the above problem.</p>
  
  <pre><code>function voterResults(arr) {
    let votesArray = ['youngVotes', 'youth', 'midVotes', 'mids', 
        'oldVotes', 'olds']
     return votesArray.reduce((acc, it) =&gt; {
       acc[it] = (acc[it] || 0) + 1  
       return acc;
     }, {})
  }
  </code></pre>
  
  <p>//output</p>
  
  <pre><code>{
     youngVotes: 1 ,
     youth: 1 ,
     midVotes: 1 ,
     mids: 1 ,
     oldVotes: 1 ,
     olds: 1
  }
  </code></pre>
  
  <p><strong>Actual output needed:</strong> </p>
  
  <pre><code>{
    youngVotes: 1,
    youth: 4,
    midVotes: 3,
    mids: 4,
    oldVotes: 3,
    olds: 4 
  }
  </code></pre>