Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 10:35, 15 August 2025 by Dylan (talk | contribs) (replace incorrect link to Conditional operator with Comparison operator)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A condition is a statement that evaluates to a boolean value.

They are often used in selection statements (such as if statements) to branch code (do different things based on input).

Conditional operators

Conditional operators are the syntax used to evaluate a statement to a boolean value.

See: Comparison operator.

Conditional statements

Conditional statements are selection: they allow us to branch code based on the result of a condition.

The main conditional statement is the if statement, but there are other types of selection, such as the switch statement and match statement.