Excellent work! 👏 In this lesson, we’ve learned the following concepts:
&&operator translates to AND and returns
trueonly when both operands are
true. It returns
falsein all other cases.
||operator translates to OR and returns
truewhen either operands are
true. When both operands are
false, the logical expression evaluates to
!operator translates to NOT and negates a Boolean value.
&&operator has a higher precedence over the
(), 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!
When you’re ready to move on, click Up Next.