January 2014
Intermediate to advanced
736 pages
70h 43m
English
The entire body of our maximum method could also be implemented with two calls to Math.max, as follows:
return Math.max( x, Math.max( y, z ) );
The first call to Math.max specifies arguments x and Math.max( y, z ). Before any method can be called, its arguments must be evaluated to determine their values. If an argument is a method call, the method call must be performed to determine its return value. So, in the preceding statement, Math.max( y, z ) is evaluated to determine the maximum of y and z. Then the result is passed as the second argument to the other call to Math.max, which returns the larger of its two arguments.
Read now
Unlock full access