Pages

Javascript Math - min Method

Description:

This method returns the smallest of zero or more numbers. If no arguments are given, the results is +Infinity

Syntax:

Math.min(value1, value2, ... valueN ) ;
Here is the detail of parameters:
  • value1, value2, ... valueN : Numbers.

Return Value:

Returns the largest of zero or more numbers.

Example:

<html>
<head>
<title>JavaScript Math min() Method</title>
</head>
<body>
<script type="text/javascript">

var value = Math.min(10, 20, -1, 100);
document.write("First Test Value : " + value ); 
  
var value = Math.min(-1, -3, -40);
document.write("<br />Second Test Value : " + value ); 

var value = Math.min(0, -1);
document.write("<br />Third Test Value : " + value ); 

var value = Math.min(100);
document.write("<br />Fourth Test Value : " + value ); 
</script>
</body>
</html>
This will produce following result:
First Test Value : -1
Second Test Value : -40
Third Test Value : -1
Fourth Test Value : 100 
 
+JavaScript +JavaScript Frameworks Links +Javascript Development 
+JavaScript's and More, Software and Marketing +JavascriptU +JavaScriptOn 
+Javascript Problems +JavaScriptOn 
 +javaScript is a creek in West Virginia in the summe  
+enJineS +JavascriptU +Javascript Tutor   

No comments:

Flag Counter
| Copyright © 2013 Remote Tutor