JavaScript Reference/Javascript Methods/max

Материал из Web эксперт
Перейти к: навигация, поиск

"max()" Example

    
<html>
<body>
<button onclick="alert(Math.max(1, 2));">MAX</button>
</body>
</html>



"max()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |Math                                                          |
+----------------+--------------------------------------------------------------+



"max()" Syntax, Parameters and Note

Note:
Evaluates two numbers and returns the larger one.
    
Syntax:
    
Math.max(param1, param2)
Parameters:
    param1   Required; the first number.
    param2   Required; the second number.