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.
Luau
json.type(...values: any) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
...values | any | Only the first value is inspected; additional values are ignored. |
Returns
stringA string describing the first value. With no arguments, the label is no value.
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