Chapter 8. KEEPING TRACK OF INFORMATION WITH ARRAYS AND LOOPS

The last chapter showed you how JavaScript stores radio buttons and pull-down menu options in lists. In programmer's parlance, lists are called arrays. This chapter will teach you how to create your own arrays and use them to keep track of large amounts of information.

In this chapter, you'll learn how to:

  • Use JavaScript's built-in arrays to control your HTML

  • Create new arrays of your own information

  • Use loops to search through arrays for information

Real-World Examples of Arrays

JavaScript's built-in arrays are useful in a wide variety of applications. One of the sites I work on, http://www.antweb.org, uses JavaScript's built-in arrays to show users which species of ants live in various ...

Get The Book of JavaScript, 2nd Edition 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.