JavaScript Booleans

Lesson Progress
0% Complete

Booleans can only have two values: true or false.

Example

var x = 5;
var y = 5;
var z = 6;
(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.


Skip to toolbar