Instead of an array to get the string in the code?

Good evening! Can't understand what in my code is wrong. I get array maximum values and want to write new array(resultArr), but they are written as a string. How to make 7 was the first value of the array, 21 second and 10 the third?
const data = [
 [-5, 7, 1],
 [3, 21, 3],
 [-1, -1, 10],
];

getIndexOfWarmestDay(data); // 2

getIndexOfWarmestDay function(data){
 let resultArr = [];
 let max = 0; 
 for (let i = 0; i < data.length; i += 1){
 for( let j = 0; j < data[i].length; j += 1 ){
 if (data[i][j] > max){
 max = data[i][j];
}
}
 resultArr += max;
 max = 0;
}
console.log(resultArr);
}
April 3rd 20 at 17:41
2 answers
April 3rd 20 at 17:43
Solution
Can't understand what in my code is wrong.

It is not so. Why would something written ten rows instead of one:

data.map(n => Math.max(...n))
April 3rd 20 at 17:45
Solution
resultArr += max; -> resultArr.push(max)
and in array to identify the largest number and show you which index it was - Gerardo.Lowe commented on April 3rd 20 at 17:48

Find more questions by tags JavaScript