Return Largest Numbers in Arrays(doesn't work )

Tell us what’s happening:
I entered the code in another project and it worked there, but run test doesnt work

Your code so far

function largestOfFour(arr) {
  // You can do this!
  return arr;
  var g = arr[0];
    return prevv>currv?prevv:currv;

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/61.0.3163.100 Safari/537.36.

Link to the challenge:

The above code does not change g. reduce returns a new array.

Also, the following is not doing what you think it is doing.


You need to debug by putting some console.log statements at various places to see the values of certain variables before and after certain blocks of code.