JavaScript Logical Operators
JavaScript Logical Operators
Logical operators are used to determine the logic between variables or values.
Oper | Name / Link | Example |
---|---|---|
&& | AND | (x < 10 && y > 1) |
|| | OR | (x === 5 || y === 5) |
! | NOT | !(x === y) |
?? | Nullish Coalescing | x ?? y |
Notes
The ?? operator in the table above is a Logical Operator (nullish coalescing).
It is closely related to the the ??= Assignment Operator (nullish assignment).