O'Reilly logo

Internet & World Wide Web: How to Program, Fifth Edition by Abbey Deitel, Harvey Deitel, Paul Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8. JavaScript: Control Statements II

Who can control his fate?

—William Shakespeare

Not everything that can be counted counts, and not every thing that counts can be counted.

—Albert Einstein

Objectives

In this chapter you’ll:

• Learn the essentials of counter-controlled repetition

• Use the for and do...while repetition statements to execute statements in a program repeatedly.

• Perform multiple selection using the switch selection statement.

• Use the break and continue program-control statements

• Use the logical operators to make decisions.

Outline

8.1 Introduction

8.2 Essentials of Counter-Controlled Repetition

8.3 for Repetition Statement

8.4 Examples Using the for Statement

8.5 switch Multiple-Selection Statement

8.6 do...while Repetition ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required