how to check string or number in javascript code example
Example 1: js is number
Number.isInteger(value)
Example 2: javascript check if variable is number
function isNumber(n) {
return !isNaN(parseFloat(n)) && !isNaN(n - 0);
}
Number.isInteger(value)
function isNumber(n) {
return !isNaN(parseFloat(n)) && !isNaN(n - 0);
}