Freecodecamp Basic Algorithm Scripting Return Largest Numbers In Arrays

[Solved] Freecodecamp Basic Algorithm Scripting Return Largest Numbers In Arrays | Basic - Code Explorer | yomemimo.com
Question : freecodecamp basic algorithm scripting return largest numbers in arrays

Answered by : tired-tern-9xjlnagzk1v0

function largestOfFour(arr) { var newArr = [];
for(var i = arr.length - 1; i >= 0; i--){ arr[i].sort(function(a, b){return a - b});
newArr.push(arr[i][arr.length - 1])
} newArr.sort(function(a, b){return -b - a}); return newArr;
}

Source : https://www.abdulbaasit.me | Last Update : Fri, 18 Sep 20

Answers related to freecodecamp basic algorithm scripting return largest numbers in arrays

Code Explorer Popular Question For Basic