JSON Null
An empty value, represented by the literal null. It is used to indicate the intentional absence of any value.
The null
literal is used to signify that a field has no value. This is distinct from having a value of 0
, an empty string ""
, or an empty array []
. It explicitly states that the value is missing. Like booleans, null
is a lowercase literal and is not enclosed in quotes.
Use Case
Imagine a user profile where the middle name is optional. If a user doesn't have a middle name, the field could be set to null
.
{
"firstName": "Jane",
"middleName": null,
"lastName": "Doe"
}