Math.max (A, b,..., x, y)--Returns the larger value in several numbers
Max is the abbreviation of maximum, the meaning of Chinese "maximum quantity"
max function Syntax
math.max (A, b,..., x, y);
max function parameter
a,b,..., x, y-numbers of type number, which can be decimals, integers, positive, negative, 0.
max function return value
Returns the larger value of a number of values
Note: If the Max function does not give any arguments, return-infinity
document.write (Math.max (5,8,6,-5,-6));
document.write (Math.max ());
document.write (Math.max ("Dreamdu", 8));
document.write (Math.max (nan,0));
result:
8
-infinity
nan
nan
 
----------------------------------------------------- -----------------------------
math Other related functions:
math.random ()
Returns a random number between 0 and 1.
math.round ()
rounded rounding.
math.ceil ()
return value: Returns the integer that is greater than or equal to X and is closest to.
note: If X is a positive number, the decimal is "in" and if X is a negative number, the decimal "is".
Math.floor ()
Return value: Returns the integer that is less than or equal to x and closest to.
Note: If X is a positive number, the decimal is "in" and if X is negative, the decimal is "in".
JS Math.max () function