Chapter 7
Working with Arrays
IN THIS CHAPTER
Learning what arrays can do for you
Declaring an array variable
Populating an array with data
Iterating an array
Trying out multidimensional arrays
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access