Logical Operators


JavaScript logical operators combine two or more conditions and return boolean true or false accordingly.

1. && (Logical AND)

document.write(5 == 10 && 10 == 10);

// prints false

2. || (Logical OR)

document.write(5 == 10 || 10 == 10);

// prints true

3. ! (Logical Not)

document.write(!false);

// prints true