Return Largest Numbers in Arrays - return the correct answer however can't pass the challenge

Tell us what’s happening:

Your code so far

function largestOfFour(arr) {
  // You can do this!
  for(i=0;i<arr.length;i++){
    arr_2.push(Math.max.apply(null,arr[i]));
}
  return arr_2;
}
largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]);

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36.

Link to the challenge:

Hi!

Thanks for answering my question, I’ve included that statement originally indeed.

Please see screenshot.

Many thanks!
48 PM

Hi!
Thanks for taking the time! But the goal of the exercise is to return the array of the large numbers…so seems like it’s reasonable to declare it globally. As from the print screen, the output was correct.

Thoughts?

Thanks!

Got it, thanks!

I was able to pass the challenge.

Thank you for taking the time to answer my question.

how did you know to use math.max.apply?