Easy Tutorial
❮ Met Element Getelementsbyclassname Prop Select Form ❯

JavaScript min() Method

JavaScript Math Object

Example

Returns the smallest number:

Output result:


Definition and Usage

The min() method returns the number with the lowest value among the specified numbers.


Browser Support

All major browsers support the min() method.


Syntax

Parameter Values

Parameter Description
n1, n2, n3,...,nX Optional. One or more values. Prior to ECMAScript v3, this method only accepted two parameters.

Return Value

Type Description
Number The smallest value among the arguments. If no arguments are provided, it returns Infinity. If any argument is NaN, or if a non-numeric value cannot be converted to a number, it returns NaN.

Technical Details

| JavaScript Version: | 1.0 | | --- | --- |


Example

Example

Returns the smallest value:

a, b, c, d, and e output result:


JavaScript Math Object

❮ Met Element Getelementsbyclassname Prop Select Form ❯