Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Podia.

Boolean – JavaScript

Summary

In JavaScript, the Boolean values are true and false.

const trueBoolean = true;
const falseBoolean = false;

Details

Booleans are a data type in JavaScript. The Boolean values are case-sensitive and should always be written in lowercase.

Sometimes you will use these values directly. However, you will also see them indirectly when using comparison operators. You will learn more about comparison operators when you get to the conditional statements module.

Demo

Exercises

Try the following statements in the console:

true
false

References

Boolean literals on MDN

Back to: JavaScript Reference > JS Data Types