The values true
and false
are known as Boolean values.
In the above example,
we store a boolean value true
in a variable isAdmin
.
It is a good practice to name
variables that store boolean
values like a question.
In the above example,
The name isAdmin
asks the question -
"Is the user an admin or not?".
isAdmin = true
answers the question -
"Yes, the user is an admin".