Hour 7. Controlling Flow with Conditions and Loops
What You'll Learn in This Hour:
|
Statements in a JavaScript program generally execute in the order in which they appear, one after the other. Because this isn't always practical, most programming languages provide flow control statements that let you control the order in which code is executed. Functions, which you learned about in the previous hour, are one type of flow controlalthough a function might be defined first thing in your code, its statements can be executed anywhere in the script.
In this hour, you'll look at two other types of flow control in JavaScript: conditions, which allow a choice of different options depending on a value, and loops, which allow repetitive statements.
|