json.type Synchronous

Get the JSON library type label for the first supplied value. Use it when validating JSON-shaped data and you need to distinguish arrays, objects, and null. Other values retain their Luau type labels.

Syntax
Luau
json.type(...values: any) -> string

Parameters

Function parameters
ParameterTypeDescription
...valuesanyOnly the first value is inspected; additional values are ignored.

Returns

string

A string describing the first value. With no arguments, the label is no value.

Example

Example
Luau
print(json.type(json.array())) -- array
print(json.type(json.object())) -- object
print(json.type(json.null)) -- null
print(json.type(nil)) -- nil
print(json.type()) -- no value
Kawaii documentation