false value

The false value means false. It can be used in conditionals with if and elseif to test them for truth, as well as to determine the presence of an element or property.

Syntax

javascriptfalse;

Example

Let's check if the array contains the letter 'e':

javascriptlet arr = ['a', 'b', 'c', 'd'];
console.log(arr.includes('e'));

The code execution result:

javascriptfalse

Example

Let's check if a value of the variable is equal to 2:

javascriptlet num = 1;
console.log(num === 2);

The code execution result:

javascriptfalse

Example

Let's check the result of the condition:

javascriptlet test = false;

if(test === false) {
  console.log('+++');
} else {
  console.log('---');
}

The code execution result:

javascript'+++'

See also

  • the true value
    that indicates that the element value is true
  • the null value
    that denotes the absence of an object or element
  • the undefined value
    that denotes that the element value is "undefined"