Table of Contents

    Booleans in JavaScript: Understanding Usage and Examples

    Booleans in JavaScript: Understanding Usage and Examples

    Booleans can only have two values: true or false.

    
    var x = 10;
    var y = 10;
    var z = 12;
    (x == y)       // Returns true
    (x == z)       // Returns false
    

    Booleans are often used in conditional testing.

    You will learn more about conditional testing later in this tutorial.