title: Why does my javascript's form loop return NAN while adding array
body: <p>I am trying to add all array elements with basic for loop for some reason, my variable 'result' return NaN.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let array = [1, 2, 3, 4, 5];
  let result = 0;
  const arraySum = (arr) =&gt; {
    for (let i = 0; i &lt;= arr.length; i++) {
      result = arr[i] + result
    }
    console.log(result)
  }
  arraySum(array)</code></pre>
  </div>
  </div>
  </p>
  <p>Please use basic looping to answer, I tried .reduce method but want to use basic loops
  Thank you</p>