reading-notes

View on GitHub

Class 07

Contents

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.