JavaScript control structures

In this section, we will cover how to change the control structure of the program. A control structure, as the term implies, refers to the flow of execution of the program. There are two possible control structures: linear and non-linear. The linear execution (also called sequential execution) refers to the execution of the statements in the order they are listed. In comparison, the non-linear execution refers to the execution of statements regardless of the order they are listed.

There are three ways to change the control structures of a program by using:

  1. conditional statements (also called conditional logic)
  2. looping control
  3. branch logic