Control Flow

Comparison Operators II

There are two more useful comparisons we can make. Often, we might want to check if two things are equal to each other or if they are not.

  1. To check if two things equal each other, we write === (three = signs in a row).
  2. To check if two things do not equal each other, we write !== (an exclamation with two = signs in a row).

It can be confusing when to use one = sign and when to use three === signs. Use a single = to assign a value to a variable. Use ===to compare the values of two different variables.

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.