check-typeof

Check whether variable is object or array or number or string or undefined or boolean

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
check-typeof
000.0.26 years ago6 years agoMinified + gzip package size for check-typeof in KB

Readme

check-typeof
Npm package to checks the variable type is an array or object or string or number or boolean or undefined

Installation

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
}