title: Calculate Average of JSON Values
body: <p>I am trying to calculate the average of JSON values, I tried to add them to an array but not able to. Can someone please help?</p>
  
  <p>My code:</p>
  
  <pre><code>Object.values(data).forEach(d =&gt; {
    var yo = d.values;
    console.log(yo);
  });
  </code></pre>
  
  <p>My results:</p>
  
  <pre><code>9892308
  9894522
  3298714
  3300055
  </code></pre>
  
  <p>I need to calculate the average of these values. How do I do that?</p>
  
  <p>Code to push values in an array: </p>
  
  <pre><code>Object.values(data).forEach(d =&gt; {
    var theArray = [];
    var yo = d.values;
    theArray = theArray.push(yo);
    console.log(theArray);
  });
  </code></pre>
  
  <p>Result: </p>
  
  <pre><code>  1
  </code></pre>
  
  <p>I am not able to push the values for me to calculate the array.</p>