JSON Boolean
A logical value that can only be true or false. These literals are not enclosed in quotes.
Booleans are fundamental for representing binary states, such as "isActive": true
or "hasPermission": false
. It is crucial to remember that true
and false
are lowercase literals. They are not strings, so they must not be enclosed in quotes.
Common Mistake
Writing "isComplete": "true"
is incorrect if you intend to represent a boolean. The correct format is "isComplete": true
. The former is a string, while the latter is a proper boolean value.