title: Add all values in an array JavaScript/jquery
body: <pre><code>&lt;div id="timeCalac"&gt;Click me to calculate your average time&lt;/div&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>myData = [34, 67, 78];
  var arrayTotalValue = 0;
  
  $("#timeCalac").click(function () {
      // arrayTotalValue = add value of myData array function
      arrayTotalValue = arrayTotalValue/myData.length;
      $("#timeCalac").html(arrayTotalValue);    
  });
  </code></pre>
  
  <p>I am making a function that records how long it took for the user to click on a element
  I then use the <code>.push()</code> command to add this number to the myData array.
  Is there a JavaScript or jQuery function that can add the value of the myData array and then store it in the arrayTotalValue variable.</p>