Introduction
Control Flow
Syntax
if in Action
Introduction
The if expression is a conditional statement. It allows you to incorporate conditions in your code which need to be fulfilled before the code can execute.
Conditional statements are incredibly powerful as they take the state of the program into consideration and act accordingly. This results in smarter compilation as the compiler is now provided with a decision-making capability.
Control Flow
Let’s look at the control flow of if.