Thursday, November 20, 2025
HomeLanguagesJavascriptLodash _.isInteger() Method

Lodash _.isInteger() Method

The Lodash _.isInteger() Method checks whether the given value is an Integer or not and returns the corresponding boolean value.

Syntax:

_.isInteger( value )

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

  • value: This parameter holds the value that need to be checked for an Integer.

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

Example 1: 

Javascript




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


Output:

The Value is Integer : true

Example 2: For string containing an integer, this method returns false.

Javascript




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


Output:

The Value is Integer : false

Example 3: For Infinity value, it returns false.

Javascript




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


Output:

The Value is Integer : false
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32405 POSTS0 COMMENTS
Milvus
97 POSTS0 COMMENTS
Nango Kala
6777 POSTS0 COMMENTS
Nicole Veronica
11925 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11995 POSTS0 COMMENTS
Shaida Kate Naidoo
6905 POSTS0 COMMENTS
Ted Musemwa
7162 POSTS0 COMMENTS
Thapelo Manthata
6861 POSTS0 COMMENTS
Umr Jansen
6846 POSTS0 COMMENTS