Home » JavaScript Math min() Method

JavaScript Math min() Method

by Online Tutorials Library

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.

Test it Now

Output:

12  -24  

Example 2

Let’s see an example to print the minimum value of the given array.

Test it Now

Output:

9  

Next TopicJavaScript Math

You may also like