Syntax
json.type(value: any): stringArguments
| Name | Type | Description |
|---|---|---|
value | any | New value to write. |
Returns
| Name | Type | Description |
|---|---|---|
jsonType | string | JSON-aware type name. |
Description
Returns the JSON-aware type of a value, including array, object, and null markers.
Call it with 1 parameter(s): value. The argument table explains which values are required and which ones only refine the behavior.
It returns jsonType (string). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Report the JSON-aware type of values and marked tables.
print(json.type(json.array()))
print(json.type(json.object()))
print(json.type(json.null))
print(json.type("text"))