Question: The following code returns the max value of an array. How to make this code handle negative values ? Coding Area 1 function max(values) var
The following code returns the max value of an array. How to make this code handle negative values ?

Coding Area 1 function max(values) var maxSoFar = 0; if(values.length-0)t 4 return null; 6 7 8 9 10 for ength;i++) { (var if(values[ijmaxSoFar) i=0;values. maxSoFar = values[i]; 12 13 return maxSoFar
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
