Return Largest Numbers in Arrays- can t find whats wrong

Tell us what’s happening:

Your code so far


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]])
};

Your browser information:

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.

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

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]