JavaScript Reference/Javascript Methods/min

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

"min()" Example

   <source lang="javascript">
   

<html> <body> <button onclick="alert(Math.min(1, 2));">get the min value from two</button> </body> </html>


     </source>
   
  


"min()" is applied to

   <source lang="javascript">

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

     </source>
   
  


"min()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Evaluates two numbers and returns the smaller one.

Syntax:

Math.min(param1, param2) Parameters:

   param1   Required; the first number.
   param2   Required; the second number.
   
     
     </source>