check-typeof
Npm package to checks the variable type is an array or object or string or number or boolean or undefinedInstallation
Installation is easiest through npm:npm install check-typeof --save
Usage
var $ = require('check-typeof');
if ($.isArray(variable_name)) { //if true
//your code
}
if ($.isObject(variable_name)) { //if true
//your code
}
if ($.isString(variable_name)) { //if true
//your code
}
if ($.isNumber(variable_name)) { //if true
//your code
}
if ($.isBoolean(variable_name)) { //if true
//your code
}
if ($.isUndefined(variable_name)) { //if true
//your code
}