Skip to content

typeOf

typeOf(value) → string · Type

Return the type of a value as a string ("string", "number", "boolean", "array", "object", "null").

  • value (required): any value
utlx
typeOf("hello")                          // "string"
typeOf(42)                               // "number"
typeOf([1, 2])                           // "array"
typeOf({a: 1})                           // "object"

Released under AGPL-3.0.