Detects the exact type of a value very quickly.
If it is an object, Object.prototype.toString is used.
Object.prototype.toString
Some value.
If it's truthy and value is an object, returns the previous cache result.
value
The string tag if value is an object; otherwise, "null" or typeof value.
"null"
typeof value
typeOf(null) // "null"typeOf(Map) // "Function"typeOf({}) // "Object"typeOf([]) // "Array"typeOf(Number()) // "number"typeOf(new Number()) // "Number" Copy
typeOf(null) // "null"typeOf(Map) // "Function"typeOf({}) // "Object"typeOf([]) // "Array"typeOf(Number()) // "number"typeOf(new Number()) // "Number"
3.0.0-beta.0
Default value for the second parameter of typeOf.
typeOf
Detects the exact type of a value very quickly.
If it is an object,
Object.prototype.toStringis used.