Array sum that I got from a for loop returns NaN (Javascript) : <p>That function below returns <strong>NaN</strong> instead of expected <strong>4</strong>. I bet there's some obvious mistake, but I'm not seeing it.</p>

<pre><code>function myFunction(arr) {
    let arrSum = 0
    for (let i=0; i&lt;=arr.length; i++) {arrSum += arr[i];}
    return arrSum;
}
const myArr = [2,2];
console.log(myFunction(myArr));
</code></pre>
