json. values Synchronous
Collect the values of a table into an array. Use it when you need the contents of a table without its keys, such as collecting values for a summary. Separate keys and values calls should not be treated as an ordered pair of arrays.
Luau
json.values(value: Table) -> {any}Parameters
| Parameter | Type | Description |
|---|---|---|
value | Table | Table whose values should be collected. |
Returns
{any}An array containing the table values. Do not depend on table iteration order.
Example
Luau
local total = 0
for _, count in ipairs(json.values({ imported = 3, skipped = 2 })) do
total += count
end
print(total) -- 5