Sunday, June 14, 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
32515 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6897 POSTS0 COMMENTS
Nicole Veronica
12013 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6964 POSTS0 COMMENTS