json. isNull Synchronous
Test whether a value is the json.null singleton used to preserve JSON null values. Use it to distinguish an explicit null in a document from a missing field. This preserves the difference between “clear this value” and “no value supplied.”
Luau
json.isNull(value: any) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to compare with json.null. |
Returns
booleantrue only for json.null. A Luau nil is not the json.null singleton.
Example
Luau
local result = json.decode('{"value":null}')
print(json.isNull(result.value)) -- true