Logical Operators

noun

say it: “LOJ-ih-kul OP-er-ay-terz” /ˈlɒdʒɪkəl ˈɒpəreɪtərz/

Symbols that combine true/false checks: && (and) needs both to be true, || (or) needs at least one, and ! (not) flips true and false.

What is Logical Operators in JavaScript?

Logical Operators — and, or and not: they combine True/False checks.

const age = 20;
const hasTicket = true;
const canEnter = age >= 18 && hasTicket;

In a sentence

  • “I used logical operators: age >= 16 && hasHelmet decides who can rent an e-bike.”

Level: Novice · More JavaScript terms at this level

Updated

In other subjects