is-null
Determine if a value is Null
install
npm i @silen/is-null
api
declare function isNull(val: any): boolean;
usage
const { isNull } = require('@silen/is-null');
// or
import { isNull } from '@silen/is-null';
console.log(isNull(new Buffer(4)));
console.log(isNull(Buffer.alloc(4)));
console.log(isNull(undefined));
console.log(isNull(null));
console.log(isNull(''));
console.log(isNull(true));
console.log(isNull(0));
console.log(isNull(1));
console.log(isNull(1.0));
console.log(isNull('string'));
console.log(isNull({}));
console.log(isNull(function foo() {}));
console.log(isNull(Symbol()));
console.log(isNull(new Set));
console.log(isNull(new Map));
console.log(isNull(new WeakMap));
console.log(isNull(new WeakSet));
// or
console.log(window.Type.isNull(new WeakSet));
This is a demo for testing the usage of isNull
from @silen/is-null
module. You can try the others and do likewise.
others
- type
- isArray
- isUndefined
- isBoolean
- isBuffer
- isArrayBuffer
- isFormData
- isArrayBufferView
- isString
- isNumber
- isObject
- isPlainObject
- isDate
- isArguments
- isFile
- isBlob
- isFunction
- isSymbol
- isRegExp
- isInt8Array
- isUint8Array
- isUint8ClampedArray
- isInt16Array
- isUint16Array
- isInt32Array
- isUint32Array
- isFloat32Array
- isFloat64Array
- isError
- isPromise
- isSet
- isWeakSet
- isMap
- isWeakMap
- isStream
- isURLSearchParams