Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR BASIC

freecodecamp basic algorithm scripting return largest numbers in arrays

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 by www.abdulbaasit.me #
 
PREVIOUS NEXT
Tagged: #freecodecamp #basic #algorithm #scripting #return #largest #numbers #arrays
ADD COMMENT
Topic
Name
2+3 =