Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

function find_max(nums) { 2 let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers 3 for (let num of nums) { 4 if (num > max_num) { 5 // (Fill in the missing line here) 6 } 7 } 8 return max_num; 9 }

1 function find_max(nums) {
2 let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers
3 for (let num of nums) {
4 if (num > max_num) {
5 // (Fill in the missing line here)
6 }
7 }
8 return max_num;
9 }
Source by iqcode.com #
 
PREVIOUS NEXT
Tagged: #function #smaller #numbers #num #missing #line #return
ADD COMMENT
Topic
Name
9+1 =