Check whether a value exists and is, in fact, a number - Node.js Number

Node.js examples for Number:Parse

Description

Check whether a value exists and is, in fact, a number

Demo Code


// check whether a value exists and is, in fact, a number.
module.exports = function isNumber(a) {
    return a !== null && isFinite(a);
}

Related Tutorials