Last Updated : 04 Sep, 2024
Lodash _.isInteger() method checks whether the given value is an Integer or not and returns the corresponding boolean value.
Syntax:_.isInteger(value);Parameters:
Example 1: In this example, we are getting true as the lodash _isInteger() method is returning true because 100 is an integer value.
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: In this example, we are getting false as the lodash _isInteger() method is returning false because the given value is a string, not an integer.
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: In this example, we are getting false as the lodash _isInteger() method is returning false because the given value is Infinity, not an integer.
JavaScript
// Defining Lodash variable
const _ = require('lodash');
// Checking for Integer
console.log("The Value is Integer : "
+ _.isInteger(Infinity));
Output:
The Value is Integer : false
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4