JavaScript Logical Operators

JavaScript Logical Operators are used to create boolean conditions, modify a boolean expression, or combine two or more simple conditions to form a complex condition.

Logical Operator – Symbol – Example

JavaScript supports the following logical operators.

Logical OperationOperator SymbolExample
AND&&a && b
OR||a || b
NOT!!a
ADVERTISEMENT

Tutorials

The following JavaScript tutorials cover each of these logical operators in detail.

Example

In the following example, we take two boolean values, and perform different Logical Operations on these values.

index.html

Conclusion

In this JavaScript Tutorial, we learned about Logical Operators, their syntax, and usage with examples.