6Repeating actions in programs

A graphical representation shows a human figure standing on the pier with a fishing rod. Two other men are standing in front of the theme park in the background.

What you will learn

In the last chapter, you learned how a program can make decisions and change its behavior according to the data that it is given. In this chapter, you are going to discover how to make a program repeat a sequence of actions using the JavaScript loop constructions. Along the way, we’re going to explore some new features of HTML and JavaScript. We are also going to discover some ways that programs can go wrong and how good design can reduce the chances of a program failing.

App development

Investigate list elements

Building web pages from code

More multiplication table fun

What you have learned ...

Get Begin to Code with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.