Ankaj Gupta
March 22, 2019
Boolean datatype in javascript

JavaScript Boolean Datatype

Boolean data-type represents a logical truth value, either true or false, that are associated with the logic branch of mathematics. You can assume the values as "on or off", "yes or no", or "correct or incorrect" or "1 or 0".

It is used to represent the truth values that are associated with the logic branch of mathematics, which informs algorithms in computer science.

Note : Boolean values are very commonly are used when testing conditions, like condition and looping statements.

let's see an example of Boolean datatype :

 ➤ Example :

<script>
    var a =10, b =25, c = 15;
    document.write(b > a);  // Output: true
    document.write(b < c);  // Output: false
</script>
JavaScript