JSON Booleans

JSON Booleans

Well, sometimes, we need the data value in the form of true or false, like in a situation, where we need to specify whether the person is married or not, in a value, we can pass it as true or false. So, in such situations, we have this type of boolean with us.

So, whenever we need to have the values like true or false, we can have them in our data.

Let’s have a look at a simple example, which would make us understand the boolean data and its use.

For example:

{
“isIndian”:true,
“hasPassed”:true
}

As you can see, we have the values as true or false. So, whenever we are required to use such yes or no kind of values, we can make use of boolean-type data.