Operators are special symbols used to assign, compare, combine, or simply, check values.

Up until this point, we’ve worked with various operators supported by Swift including arithmetic operators (like + and -), comparison operators (like > and <), the assignment operator (=), and more. In this lesson, we’ll explore another type of fundamental operators known as logical operators.

Logical operators determine a boolean result after combining or modifying true or false values. Swift supports the following logical operators:

  • && (AND)
  • || (OR)
  • ! (NOT)

Take a look at the tables on the right for a preview of each operator’s behavior. We’ll explain each behavior in depth in the upcoming exercises.


If you’re ready && excited to learn more about logical operators, click Next!

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?