JavaScript Logical Operator With Example

Card image cap

JavaScript Operators Definition:

An operator that performs some operation on single or multiple operands and produces a result is called Operators.

An Operators are symbols or keyword that enable JavaScript to perform some sort of actions.


JS Logical Operators

The logical operators are typically used to combine conditional statements

Operator Name Example Result
&& And x && y True if both x and y are true
|| Or x || y True if either x or y is true
! Not !x True if x is not true

Example:


Result:


  2020 is a leap year. 



Read Also:


Card image cap