# Return Largest Numbers in Arrays- can t find whats wrong

Tell us what’s happening:

``````
function largestOfFour(arr) {

var x ;
var arr2=[];
for (var i = 0; i < 4; i++) {
x= arr[i,0];
for (var j = 0; j < 4; j++) {

if (arr[i,j] > x) {
x = arr[i,j];

}

}

arr2.push(x);

return arr2;
}

largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]])
};
``````

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

This isn’t valid syntax:

``````x= arr[i,0];
``````

You access arrays by index like

``````x = arr[i]
``````

If you’re accessing an array in another array, it’s the same:

``````x = arr[i][j]
``````

`arr[i]` is an array, so you access values in that array the same way

``````var arr = [[1,2],[3,4]]
var firstSubArray = arr[0]
// That is an array, so to get the first value (1):
var firstElementInSubArray = firstSubArray[0]
// Or just do
var firstElementInSubArray = arr[0][0]
``````