Saturday, November 15, 2025
HomeLanguagesJavascriptLodash _.isNumber() Function

Lodash _.isNumber() Function

Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc.

The _.isNumber() method is used to find whether the given value parameter is number or not. If the given value is a number then it returns True value otherwise, it returns False.

Syntax:

_.isNumber(value)

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

  • value: This parameter holds the value to check.

Return Value: This method returns true if the value is a number, else false.

Example 1: Here, const _ = require(‘lodash’) is used to import the lodash library into the file.

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
     
// Use of _.isNumber() method 
  
console.log(_.isNumber(10)); 
console.log(_.isNumber('neveropen')); 
console.log(_.isNumber(15.675));


Output:

true
false
true

Example 2:  

Javascript




// Requiring the lodash library  
const _ = require("lodash");  
     
// Use of _.isNumber()  
// method 
  
console.log(_.isNumber(true));
console.log(_.isNumber(Number.MIN_VALUE)); 
console.log(_.isNumber(Infinity));
console.log(_.isNumber('3'));


Output:

false
true
true
false
Previous article
Next article
RELATED ARTICLES

Most Popular

Dominic
32399 POSTS0 COMMENTS
Milvus
95 POSTS0 COMMENTS
Nango Kala
6765 POSTS0 COMMENTS
Nicole Veronica
11917 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11984 POSTS0 COMMENTS
Shaida Kate Naidoo
6889 POSTS0 COMMENTS
Ted Musemwa
7143 POSTS0 COMMENTS
Thapelo Manthata
6838 POSTS0 COMMENTS
Umr Jansen
6840 POSTS0 COMMENTS