Last Updated : 04 Sep, 2024
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:
Example 1: In this example, we are checking whether the given value is a finite number or not.
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: In this example, we are checking whether the given value is a finite number or not. 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: In this example, we are checking whether the given value is a finite number or not. 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: In this example, we are checking whether the given value is a finite number or not.
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
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