85
JavaScript Math min() method
The JavaScript math min() method compares the given numbers and returns the minimum value.
Syntax
The min() method is represented by the following syntax:
Parameter
num1,num2,…,numN – Numbers to be compared..
Return
A minimum value of the given numbers.
JavaScript Math min() method example
Here, we will understand min() method through various examples.
Example 1
Let’s see a simple example to print the minimum value of the given numbers.
Output:
12 -24
Example 2
Let’s see an example to print the minimum value of the given array.
Output:
9
Next TopicJavaScript Math