title: Simple Array Sum using javascript (single integer)
body: <p>Been finding the this sum difficult to solve:</p>
  
  <p>Question:
  Given an array of integers, find the sum of its elements.</p>
  
  <p>For example, if the array ar = [1,2.3],1+2+3=6 so return 6.</p>
  
  <p>Function Description</p>
  
  <p>Complete the simpleArraySum function in the editor below. It must return the sum of the array elements as an integer.</p>
  
  <p>I have tried:</p>
  
  <pre><code>function simpleArraySum(ar) {
      var sum = 0;
      for (var i = 0; i &lt;ar.length; i++) {
      sum += (ar);
      return sum;
      }
  }
  </code></pre>
  
  <p>Output is: 01,2,3,4,10,11</p>
  
  <p>It should be 31.</p>
  
  <p>Help please</p>