check datatype nodejs code example
Example 1: node js check type of variable
if (typeof i != "number") {
console.log('This is not number');
}
Example 2: check data type in javascript
typeof("string"); //string
typeof(123); //number
if (typeof i != "number") {
console.log('This is not number');
}
typeof("string"); //string
typeof(123); //number