DEV Community

Randy Rivera
Randy Rivera

Posted on

Boolean Values

Understanding Boolean Values

Another data type is the Boolean. Booleans may only be one of two values: true or false.

Note: Boolean values are never written with quotes. The strings "true" and "false" are not Boolean and have no special meaning in JavaScript.

  • Example:
function welcomeToBooleans() {
  return true;
}
welcomeToBooleans(); // will display true

function welcomeToBooleans() {
 return false; 
}
welcomeToBooleans(); // will display false
Enter fullscreen mode Exit fullscreen mode

Top comments (0)