title: How to add together an array of numbers in javascript?
body: <p>I have to take an array of 12 numbers and add them together then call one function to get the average of the numbers and another to get the total of the numbers.</p>
  
  <p>My array looks like this:</p>
  
  <pre><code>monthlySales[0] = 30000;
  monthlySales[1] = 10000;
  monthlySales[2] = 15000;
  monthlySales[3] = 20000;
  monthlySales[4] = 20000;
  monthlySales[5] = 25000;
  monthlySales[6] = 22000;
  monthlySales[7] = 80000;
  monthlySales[8] = 20000;
  monthlySales[9] = 20000;
  monthlySales[10] = 40000;
  monthlySales[11] = 60000;
  </code></pre>
  
  <p>I have to use this to get the arrays values somehow:</p>
  
  <pre><code>lookedUpMonthlySales = chosenIndex
  monthlySales[chosenIndex]
  </code></pre>
  
  <p>Im just not sure how to get the values of the arrays from the array into my other two functions and then how to add them together and to get the average of them.</p>