nodejs see variable type code example
Example 1: node js check type of variable
if (typeof i != "number") {
console.log('This is not number');
}
Example 2: how to get type of variable in javascript
> typeof "foo"
"string"
> typeof true
"boolean"
> typeof 42
"number"