**Tell us what’s happening:**

I put this code together but was getting a few errors. Specifically this "Type Error: Cannot read property ‘1’ of undefined.

I took a glance at the answer on the hint page and understand how that code works. I’m just trying to understand why I’m getting this error and if this code would work despite being a messier solution.

Thanks.

**Your code so far**

```
function largestOfFour(arr) {
// You can do this!
var largest = 0;
var largest_array;
for (i = 0; i < arr.length; i++){
for (j = 0; j < arr[j].length; j++){
if (arr[i][j] > largest){
largest = arr[i][j];
if (j === (arr[j].length - 1) )
largest_array.push(largest);
largest = 0;
}
arr = largest_array;
}
return arr;
}
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
```

**Your browser information:**

Your Browser User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36`

.

**Link to the challenge:**