Class 07
Contents
- Home Page
- Class 01
- Class 02
- Class 03
- Class 04
- Class 04 Website
- Class 05 Website
- Class 05
- Class 06 Website
- Class 06
- Class 07 Website
- Class 07
- Class 08
- Class 08 Website
Control Flow
Code is run from the first to the last line in the file. That said this can be changed by conditionals and loops.
What happens next can be changed by if
and else
conditions that will change the flow of the DOM dependent on certain conditions being met.
A typical script in JavaScript includes many control structures, including conditionals, loops and functions. Parts of a script may also be set to execute when events occur.
Control flow means that when you read a script, you must not only read from start to finish but also look at program structure and how it affects order of execution.