Tuesday, February 17, 2026
HomeLanguagesJavascriptLodash _.min() Method

Lodash _.min() Method

Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc. 

The _.min() method is used to find the minimum element from the array. If the array is empty then undefined is returned.

Syntax:

_.min( array )

Parameters: This method accepts a single parameter as mentioned above and described below:

  • array: It is the array that the method iterates over to get the minimum element.

Return Value: This method returns the minimum element from the array.

Example 1:

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
    
// Use of _.min() method 
let min_val = _.min([]); 
        
// Printing the output  
console.log(min_val);


Output:

undefined

Example 2:

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
    
// Use of _.min() method 
let min_val = _.min([15, 7, 38, 46, 82]); 
        
// Printing the output  
console.log(min_val);


Output:

7

Example 3:  

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
    
// Use of _.min() method 
let min_val = _.min([-15, 7, 38, -46, -82]); 
        
// Printing the output  
console.log(min_val);


Output:

-82
RELATED ARTICLES

1 COMMENT

Most Popular

Dominic
32506 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6882 POSTS0 COMMENTS
Nicole Veronica
12005 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12099 POSTS0 COMMENTS
Shaida Kate Naidoo
7011 POSTS0 COMMENTS
Ted Musemwa
7255 POSTS0 COMMENTS
Thapelo Manthata
6967 POSTS0 COMMENTS
Umr Jansen
6956 POSTS0 COMMENTS