Why is my "<=" in a for loop throwing an exception?

I just finished the Return Largest Numbers in Arrays challenge in the Basic Algorithm Scripting, but I was stuck on it for a long time. My code seemed right, but I kept getting this error: “TypeError: Cannot read property ‘0’ of undefined.” Turns out I mistakenly used a “<=” instead of a “<” in my first for loop. Once I changed that, the code executed perfectly. But I’m left wondering why it was a problem at all. Sure, it was a logical error, but why was the code getting hung up there? Can someone clear this up for me? I’ve attached my (incorrect) code below.

function largestOfFour(arr) {
// You can do this!
var newArr = [];
for(var i = 0; i<= arr.length; i++) { //this is the offending line
var biggest = arr[i][0];
for(var j = 1; j<=arr.length; j++){
if (arr[i][j] > biggest){
biggest = arr[i][j];
}
newArr[i] = biggest;
}
}
return newArr;
}