Chapter 7

Working with Arrays

IN THIS CHAPTER

Bullet Learning what arrays can do for you

Bullet Declaring an array variable

Bullet Populating an array with data

Bullet Iterating an array

Bullet Trying out multidimensional arrays

Bullet Working with JavaScript’s Array object

The disorder of the desk, the floor; the yellow Post-It notes everywhere; the whiteboards covered with scrawl: all this is the outward manifestation of the messiness of human thought. The messiness cannot go into the program; it piles up around the programmer.

—ELLEN ULLMAN

I’ve talked quite a bit about efficient programming in this book because I believe (okay, I know) that efficient scripts run faster and take less time to program and debug. Efficiency in programming really means eliminating unnecessary repetition, whether it’s consolidating statements into a loop that can be repeated as often as required (refer to Book 4, Chapter 4) or moving code into ...

Get HTML, CSS, & JavaScript All-in-One For Dummies 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.