Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

var maxNum = function(arr) {};

var maxNum = function(arr) {
    let largestNum = 0;
    for (let i = 0; i < arr.length; i++) {
        if (arr[i] > largestNum) {
            largestNum = arr[i];
        }
    }
    return largestNum;
};
 
PREVIOUS NEXT
Tagged: #var #maxNum
ADD COMMENT
Topic
Name
1+4 =