title: How do I sum total amount of array in loop?
body: <p>How would I sum the total of amount that is returned in array by using Ajax?</p>
  
  <p>Is there other way to calculate the sum with amount of .000 behind?</p>
  
  <p><strong>Example:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code> for (i = 0; i &lt; data.RecordCount; i++) {
  
   totalBetAmount += parseFloat(data.Records[i].betAmount);
  </code></pre>
  
  <p><strong>Result:</strong> 0.22130000001</p>