function largestOfFour(arr) {
// use the map function to sort each array big to small. Return the 1st value.
arr = arr.map (function(x) {
x = arr.sort (a, b)
{
var sort = b - a;
return sort;
}
});
var largest_numbers = [];
for (i = 0; i < arr.length; i++) {
var index_zero_numbers = arr[i][0];
largest_numbers = largest_numbers.push[index_zero_numbers];
}
return largest_numbers;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Anyone see the problem?