Swift Booleans
Swift Booleans
Bool represents logical true/false. Combine conditions with &&, ||, and negate with !.
Boolean Logic
Combine boolean values using logical AND (&&), OR (||), and negate with NOT (!).
This example shows logical AND, OR and NOT.
Comparison Results
Relational operators like >, ==, and != return Bool values that you can use in conditions.
Example
let a = 5, b = 3
print(a > b) // true
print(a == b) // false
print(a != b) // true
Comparisons like >, ==, and != produce Bool values you can combine with logical operators.