js-variable-type
1.0.5 • Public • Published
npm install js-variable-type
import {
isObject,
isArray,
isString,
isNumber,
isNull,
isUndefined,
isDate,
isRegExp,
isBoolean,
isFunction,
isError
} from 'js-variable-type';
console.log(`{} is Object ? -> ${isObject({})}`);
console.log(`[] is Array ? -> ${isArray([])}`);
console.log(`'string' is String ? -> ${isString('string')}`);
console.log(`100 is Number ? -> ${isNumber(100)}`);
console.log(`null is Null ? -> ${isNull(null)}`);
console.log(`undefined is Undefined ? -> ${isUndefined(undefined)}`);
console.log(`new Date() is isDate ? -> ${isDate(new Date())}`);
console.log(`new RegExp() is RegExp ? -> ${isRegExp(new RegExp())}`);
console.log(`true is Boolean ? -> ${isBoolean(true)}`);
console.log(`() => {} is Funtion ? -> ${isFunction(this.onDialogRedirect)}`);
console.log(`new Error() is Error ? -> ${isError(new Error('ddd'))}`);
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads