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.”

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

Parameters

Function parameters
ParameterTypeDescription
valueanyValue to compare with json.null.

Returns

boolean

true only for json.null. A Luau nil is not the json.null singleton.

Example

Example
Luau
local result = json.decode('{"value":null}')
print(json.isNull(result.value)) -- true
Kawaii documentation