Chapter 7
Working with Arrays
IN THIS CHAPTER
Learning what arrays can do for you
Declaring an array variable
Populating an array with data
Trying out multidimensional arrays
Working with JavaScript’s Array object
I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.
— BILL GATES
In this chapter, you discover one of JavaScript’s most important concepts: the array. Arrays are important not only because they’re extremely powerful, but because once you know how to use them, you’ll think of a thousand and one uses for them. To make sure you’re ready for your new array-filled life, this chapter explains what they are and why they’re so darn useful, and then explores all the fantastic ways that arrays can make your coding life easier.
What Is an Array?
I talk 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. As I’ve said, efficiency ...
Get Web Coding & Development 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.