Boolean Data Type
We have seen that operators like + , - , *, and / operate on numbers.
3 * 3 (result is number data type)
We have seen that the + operator has a dual role of concatanation when operating on strings.
"Scooby " + "Doo" (result is string data type)
Comparison Operators such as greater than (>) or less than (<) result in neither numeric or string data.
3 < 4 (result is Boolean data type)
The Boolean data type refers to George Boole,
a mathematician who was among the first to formalize the mathematical rules of propositional logic in the early 1800's.
The Boolean Data is either true as in (3 < 4) or false as in (4 < 3).
Boolean values are not strings like "true" or "false", which would simply be 4-character and 5-character strings, respectively.
Boolean values are simply true or false, which can literally be stored in memory in one bit, where 0 is false, and 1 is true.
Below is a full list of comparison operators that result in Boolean values.
< less than
<= less than or equal to
> greater than
>= greater than or equal to
== equals (the single equal sign is the variable assignment operator)
!= not equals
The Boolean values below result from evaluating JavaScript expressions.
See the script near the bottom of this page to see the actual expressions that generate these values.