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.

Syntax
Luau
json.isArray(value: any) -> boolean

Parameters

Function parameters
ParameterTypeDescription
valueanyValue to inspect without serializing it.

Returns

boolean

true 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

Example
Luau
local parsed = json.decode('["north","south"]')
if json.isArray(parsed) then
    for _, item in ipairs(parsed) do print(item) end
end
Kawaii documentation