The if-else Expression
This lesson will teach us how to create if-else expressions in Reason syntax.
We'll cover the following
The if
condition is one of the most relevant statements in the world of computer programming. It is supported in many popular languages such as Java, C++, and Python. The condition is used to execute certain operations if a condition is fulfilled.
The else
keyword is derived from if
. We’ll understand more about this later in the lesson.
Let’s talk about the structure of the if-else
expression.
The Structure
The structure of Reason’s if-else
expression is fairly similar to the one followed in other languages. it can be divided into 3 parts:
- The
if
condition - The expression to be executed
- The
else
expression
Get hands-on with 1400+ tech skills courses.