I would like to know why it is not working


function largestOfFour(arr) {

return arr.map((arrays) => {
  return arrays.reduce((actual, numIt) => {
    return Math.max(actual,numIt);
  },0);
});

};




largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
  **Información de tu navegador:**

El agente de usuario es: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36

Desafío: Devuelve los números mayores en los arreglos

Enlaza al desafío:

Hi @matias3363gw .

Your function has a slight bias: it only consider as possibile lowest value 0, due to the initial value of the reduce function.

If you see the example you are failing:

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

You can see that the last array contains all negative numbers:
[-72, -3, -17, -10]and your reduce function will return0as the max value for that, while it should be-3`.

Hope this helps :slight_smile: