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 }

0

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 }

By Beginner Guillermo Goyette at Jun 21 2021


Related code examples


Code examples by languages