Answer the question
In order to leave comments, you need to log in
How to display maximum values of arrays nested in parent array?
Good afternoon!
Please help me figure it out, the task is this: the function must return an array consisting of the maximum values of the arrays nested in a common array for them.
arr = ;
<script>
function largestOfFour(arr) {
var high = 0;
var finArr = [];
for (var i = 0; i < arr.length; i++){// в цикле большого массива
var subArr = arr[i]; //определяем малые
for (var a = 0; a < subArr.length; a++){//в каждом из малых
if (subArr[a] > high){ //находим наибольшее значение
high = subArr[a];
}
}
finArr.push(high);
}
return finArr;
}
var q = largestOfFour(, "");
console.log(q);
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question