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