Logical Operators
Combine multiple conditions with AND, OR, and NOT to build complex decision-making logic.
Step 1 of 5
When one condition isn't enough
Real-world decisions rarely depend on a single yes-or-no question. To board a plane, you need a valid ticket AND a photo ID. To get a student discount, you must be under 25 OR have a student card. To enter a members-only area, you must NOT be on the banned list.
JavaScript gives you three **logical operators** to combine conditions: - `&&` — **AND**: Are *both* conditions true? - `||` — **OR**: Is *at least one* condition true? - `!` — **NOT**: Flip true to false, or false to true.
These operators let you build sophisticated conditions inside a single `if` statement, instead of nesting multiple if/else blocks.
Think of it this way: Logical operators are like combining questions. AND means 'Are BOTH things true?' — like a bouncer checking that you have a ticket AND you're on the guest list. OR means 'Is AT LEAST one thing true?' — like a store accepting cash OR card. NOT flips the answer — like asking 'Is this seat NOT taken?'
Web Standard
Logical operators in JavaScript follow the same truth table rules used in formal logic and every other programming language. If you learn AND, OR, NOT here, the concepts transfer directly to Python, Java, SQL, and beyond.
Learn more on MDN