**Tell us what’s happening:**

I realize the hint was to go for a simple loop, but I thought there might be another way to go about it. Also, I’m having difficulty understanding the logic of a loop in this case…

I am attempting to organize the the sub-arrays in descending order so that I can call forth the first element of each sub-array and that would be the largest one. 1)Is this the best way to go about it? 2)If so, where am I going wrong?

The console says that I am not defining i, but I shouldn’t need to because i is the array of arrays…or should I? As you can see, I’m a bit confused.

**Your code so far**

```
function largestOfFour(arr) {
//create empty array
var result = [];
//organize elements into descending order
var arr1 = arr[i][j];
var arr2 = arr1.sort(function(a,b){
return (b-a);
});
//call forth first element of each subarray
result = arr1[j][0];
return result;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
//keep tracks of arrays highest values in another array
```

**Your browser information:**

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

.

**Link to the challenge:**

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/return-largest-numbers-in-arrays/