Learn

Excellent work! 👏 In this lesson, we’ve learned the following concepts:

  • The logical && operator translates to AND and returns true only when both operands are true. It returns false in all other cases.
  • The logical || operator translates to OR and returns true when either operands are true. When both operands are false, the logical expression evaluates to false.
  • The logical ! operator translates to NOT and negates a Boolean value.
  • The && operator has a higher precedence over the || operator.
  • Parentheses, (), may be used in a logical expression to control the order of operations and improve readability.

Feel free to utilize the empty Review.swift file and output terminal on the right to hone your understanding of logical operators and practice writing Swift code!

Instructions

When you’re ready to move on, click Up 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?