json. isArray Synchronous
Ask whether a value is represented as a JSON array. Use it before iterating a decoded value when the input is expected to be a list.
Luau
json.isArray(value: any) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to inspect without serializing it. |
Returns
booleantrue for a marked array or a nonempty unmarked table with contiguous positive integer keys; otherwise false.
Usage notes
An unmarked empty table is classified as an object. An explicit json.array marker takes precedence over its current contents.
Example
Luau
local parsed = json.decode('["north","south"]')
if json.isArray(parsed) then
for _, item in ipairs(parsed) do print(item) end
end