Tell us what’s happening:
Hey everyone! So I’m not sure what’s really happening. When I console.log my code I’m getting the right solution but somehow I keep failing. My guess is that what I’m returning is not an array, however it tells me that what I’m returning is an array. Thanks for the help!
Your code so far
function largestOfFour(arr) {
for (let i = 0; i < arr.length; i++){
arr[i].sort(function(a, b) {return a - b});
var newArr = [arr[i][3]];
console.log(newArr)
}
// You can do this!
return newArr;
}
largestOfFour([[17, 23, 25, 12], [25, 7, 34, 48], [4, -10, 18, 21], [-72, -3, -17, -10]])
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
.