Learn

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.

Instructions

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

Folder Icon

Take this course for free

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

Already have an account?