As you get each number you need to compare it with the current max and min values. If it's less than the current min, it becomes the new min, ditto for max.
You can use Math.max if you like, it needs TWO parameters and returns the larger of the two, but I recommend that you do not use it, just code the if test yourself. That way youi'll learn more, and will be in better shape for tracking which element of the array is largest, if you need to.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073