typeof(value)
Description
Parameters
Usage
log typeof("hello")
// "string"
log typeof(123)
// "number"
log typeof([1,2,3])
// "array"
log typeof({"key": "value"})
// "object"
log typeof(true)
// "boolean"
log typeof(null)
// "null"
// Can be used in conditions
if typeof(value) == "string" (
// handle string case
)Last updated