title: hasOwnProperty not working in array of objects, combining objects
body: <p>I'm trying to build an array of objects but combining similar properties and adding their values together. So many <code>x</code> array should be turned into <code>y</code> array of objects. It must be an array of objects and not just an array  </p>
  
  <pre><code> var x = [
      {"2018-09-13": "100"},
      {"2018-09-14": "50"},
      {"2018-09-14": "50"},
      {"2018-09-15": "100"}
   ];
  </code></pre>
  
  <p>Desired result</p>
  
  <pre><code> var y = [
      {"2018-09-13": "100"},
      {"2018-09-14": "50,50"},
      {"2018-09-15": "100"}
   ];
  </code></pre>
  
  <p>Here is the function I'm running to add them together but does not work. I believe it has something to do with the array index causing a problem with the <code>hasOwnProperty</code> method</p>
  
  <pre><code>var z = [];
  
  x.forEach((item) =&gt; {
      for(var date in item) {
          if(z.hasOwnProperty(date)) {
              z[date] +=  "," + item[date];
             } else {
              z.push({[date]: item[date]});
             }
           }
      })
  
  
  console.log(z)
  </code></pre>