Syntax
json.isNull(value: any): booleanArguments
| Name | Type | Description |
|---|---|---|
value | any | New value to write. |
Returns
| Name | Type | Description |
|---|---|---|
isNull | boolean | True when the value is the JSON null sentinel. |
Description
Returns whether a value is the JSON null sentinel.
Call it with 1 parameter(s): value. The argument table explains which values are required and which ones only refine the behavior.
It returns isNull (boolean). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Check for the JSON null sentinel without treating it as nil.
local value = json.decode("null")
if json.isNull(value) then
print("The value is JSON null")
end