Sunday, January 18, 2026
HomeLanguagesJavascriptLodash _.isFinite() Method

Lodash _.isFinite() Method

The Lodash _.isFinite() Method checks whether the given value is a primitive finite number or not and returns the corresponding boolean value.

Syntax:

_.isFinite( value )

 

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

  • value: This parameter holds the value that to be checked for a primitive finite number.

Return Value: This method returns a Boolean value(Returns true if the given value is finite number, else false).

Example 1: 

Javascript




// Defining Lodash variable 
const _ = require('lodash'); 
  
// Checking for Finite Value 
console.log("The Value is Finite : "
        +_.isFinite(10));


Output:

The Value is Finite : true

Example 2: For Infinity, it returns false.

Javascript




// Defining Lodash variable 
const _ = require('lodash'); 
  
// Checking for Finite Value 
console.log("The Value is Finite : "
        +_.isFinite(Infinity));


Output:

The Value is Finite : false 

Example 3: For strings, it returns false.

Javascript




// Defining Lodash variable 
const _ = require('lodash'); 
  
// Checking for Finite Value 
console.log("The Value is Finite : "
        + _.isFinite("gfg"));


Output:

The Value is Finite : false 

Example 4: 

Javascript




// Defining Lodash variable 
const _ = require('lodash'); 
  
// Checking for Finite Value 
console.log("The Value is Finite : "
    +_.isFinite(Number.MAX_VALUE));


Output:

The Value is Finite : true
RELATED ARTICLES

Most Popular

Dominic
32474 POSTS0 COMMENTS
Milvus
118 POSTS0 COMMENTS
Nango Kala
6846 POSTS0 COMMENTS
Nicole Veronica
11977 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12063 POSTS0 COMMENTS
Shaida Kate Naidoo
6985 POSTS0 COMMENTS
Ted Musemwa
7219 POSTS0 COMMENTS
Thapelo Manthata
6933 POSTS0 COMMENTS
Umr Jansen
6911 POSTS0 COMMENTS