Boolean Logic
A logical operator that returns true only if both conditions on either side are true.
Understanding Boolean Logic in JavaScript
What it does: ! flips true to false or false to true. This requires both hasTicket and hasID to be true. || returns true as long as at least one side is true. JavaScript uses &&, not the word 'and'. Logical AND requires two ampersands: &&. Logical OR requires two pipe characters: ||. ! returns the reversed boolean value of isOpen. JavaScript's logical AND operator is &&, not 'and'.
Common mistakes: Use &&, not the word 'and', to combine conditions. Use ||, not the word 'or', to combine conditions.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 11–25) and word search (Modules 1–29).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
&&Fill in the Blanks
Spot the Error
Student with a class code? Join your class →