Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript js isNumber

// strict, matches only objects of type 'number'
// excluding Infinity and NaN.
function isNumber(n) {
    return typeof n === 'number' && isFinite(n);
}
 
PREVIOUS NEXT
Tagged: #javascript #js #isNumber
ADD COMMENT
Topic
Name
2+1 =