If, Else If and Else Statements
Learn how to branch off based on conditional statements like if, else if and else statements.
We'll cover the following...
The time has come when we can fit the puzzle pieces together. You have learned about different primitive and composite types. You know how to check these types. You know the basic functions and arithmetic (addition, subtraction, multiplication, etc.) and logical (true or false) operations in JavaScript.
There are only two things missing. So far, we can write a sequence of instructions that perform a calculation. In software development, there are three types of control structures:
- sequence: writing instructions one after the other
- selection: either execute one set of instructions, or another