Selection
From Coderwiki
More actions
Selection involves making a decision based on whether a condition is true or false.
They allow us to branch our code: do different things depending on the input.
Types of selection
edit edit sourceThere are two main types of selection in programming languages:
- Condition matching: if statements
- Pattern matching: switch statements and match statements