Get the Min Value of an Array with JavaScript



In this article, you will learn how to get the min value of an array with JavaScript.

The Math.min() method

If you specify multiple numbers as arguments, the Math.min() method returns the minimum value among them.

The syntax is below.


To get the min value of the array that stores the numerical value, it is as follows.


Get the Min Value of an Array

Below is the sample code to get the minimum value of the array.

console.log(Math.min(2, 5, 3)); // 2

console.log(Math.min(-2, -5, -3)); // -5

const array=[3,6,2,9,7];
console.log(Math.min.apply(null,array)); // 2