Saturday, January 31, 2026
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
32478 POSTS0 COMMENTS
Milvus
122 POSTS0 COMMENTS
Nango Kala
6849 POSTS0 COMMENTS
Nicole Veronica
11978 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12066 POSTS0 COMMENTS
Shaida Kate Naidoo
6987 POSTS0 COMMENTS
Ted Musemwa
7222 POSTS0 COMMENTS
Thapelo Manthata
6934 POSTS0 COMMENTS
Umr Jansen
6917 POSTS0 COMMENTS