Skip to content

Booleans and comparisons

True and false

  • A boolean is one of just two values: true or false.
  • Compare values to get a boolean: === (equal), !== (not equal), < > <= >=.

5 === "5" is false but 5 == "5" is true: use === to compare value and type

Handout

Log in or create account

IGCSE, A-Level & AP