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

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output:

true
false

Example 2:  

Javascript

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output:

false
true

full-stack-img

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.