The underscore.js library is a popular utility library for JavaScript which provides a range of useful functions. One of the functions provided by this library is isNumber(), which checks if a given value is a number or not.
Example 1:
var num = 3; var checkNumber = _.isNumber(num); console.log(checkNumber); // Output: true
In this example, the variable 'num' is assigned a numeric value of 3. The isNumber() function is called with 'num' as an argument and the output is true.
Example 2:
var str = "This is a string"; var checkNumber = _.isNumber(str); console.log(checkNumber); // Output: false
In this example, the variable 'str' is assigned a string value. The isNumber() function is then called with 'str' as an argument, and the output is false.
This function is part of the underscore.js library.
JavaScript _.isNumber - 15 examples found. These are the top rated real world JavaScript examples of Underscore._.isNumber extracted from open source projects. You can rate examples to help us improve the quality of examples.