typeof
The
typeOf
method returns a string indicating the type of the value
Install
$ npm install @eteplus/typeof
Usage
Support
Node
andBrowser
const typeOf = // => 'Undefined' // => 'String' // => 'NaN' // => 'WeakMap'
API
typeOf(value)
Returns the type of value
Types:
- Null
- Undefined
- NaN
- Arguments
- Number
- String
- Array
- Object
- Date
- Boolean
- Symbol
- Map
- WeakMap
- Set
- WeakSet
- Function
- RegExp
- Promise
- Error
- ArrayBuffer
- DataView
- Int8Array
- Uint8Array
- Uint8ClampedArray
- Int16Array
- Uint16Array
- Int32Array
- Uint32Array
- Float32Array
- Float64Array