Decisions, decisions. Conditionals are how we do something, or something else.
Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.
In this unit I’ll introduce you to conditionals.
Through the use of conditionals we can tell our program “do this, or do that” depending on some condition.
The first thing I’ll introduce is how to create those conditions, using comparison operators.
Then we’ll see how to use:
ifelseswitch
and the ternary operator.
Lessons in this unit:
| 0: | ▶︎ Introduction |
| 1: | Comparison operators |
| 2: | `if` statements |
| 3: | How to use `else` |
| 4: | `switch` |
| 5: | The ternary operator |