Syntax
json.isArray(value: any): booleanArguments
| Name | Type | Description |
|---|---|---|
value | any | New value to write. |
Returns
| Name | Type | Description |
|---|---|---|
isArray | boolean | True when the value is treated as a JSON array. |
Description
Returns whether a value is marked or shaped as a JSON array.
Call it with 1 parameter(s): value. The argument table explains which values are required and which ones only refine the behavior.
It returns isArray (boolean). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Distinguish JSON arrays from JSON objects.
local items = json.array({ "one", "two" })
local record = json.object({ name = "Real" })
print(json.isArray(items))
print(json.isArray(record))