JavaScript Reference/Javascript Methods/max

Материал из Web эксперт
Версия от 11:22, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"max()" Example

   <source lang="javascript">
   

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


     </source>
   
  


"max()" is applied to

   <source lang="javascript">

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

     </source>
   
  


"max()" Syntax, Parameters and Note

   <source lang="javascript">

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.
   
     
     </source>