json. isArray Synchronous
Check whether the JSON library classifies a value as an array. Use it to check that parsed input is a list before processing its elements. Explicit metadata takes priority; an unmarked empty table is classified as an object.
Luau
json.isArray(value: any) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to inspect without encoding it. |
Returns
booleantrue if the value is classified as an array; otherwise false.
Example
Luau
print(json.isArray(json.decode("[]"))) -- true
print(json.isArray({ "red", "blue" })) -- true
print(json.isArray({})) -- false