Thursday, January 29, 2026
HomeLanguagesJavascriptLodash _.gt() Method

Lodash _.gt() Method

The _.gt() method is used to find the value is greater than other or not. It returns true, if the value is greater than the other value. Otherwise, it returns false.

Syntax:

_.gt(value, other)

Parameters: This method accepts two parameters as mentioned above and described below:

  • value: This parameter holds the value to compare.
  • other: This parameter holds the other value to compare.

Return Value: This method returns true if value is greater than the other value, else false.

Example 1:

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
  
// Use of _.gt method 
console.log(_.gt(19, 8)); 
console.log(_.gt(15, 17)); 


Output:

true
false

Example 2:  

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
  
// Use of _.gt method 
console.log(_.gt(13, 13)); 
console.log(_.gt(29, 17)); 


Output:

false
true
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32475 POSTS0 COMMENTS
Milvus
122 POSTS0 COMMENTS
Nango Kala
6848 POSTS0 COMMENTS
Nicole Veronica
11978 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12065 POSTS0 COMMENTS
Shaida Kate Naidoo
6986 POSTS0 COMMENTS
Ted Musemwa
7221 POSTS0 COMMENTS
Thapelo Manthata
6934 POSTS0 COMMENTS
Umr Jansen
6916 POSTS0 COMMENTS