Chapter 4

Understanding Arrays

In This Chapter

arrow Identifying and defining arrays

arrow Building arrays

arrow Moving beyond 2D with multidimensional arrays

arrow Working within array elements

arrow Using array functions and properties

“I am large. I contain multitudes.”

— Walt Whitman

Arrays are a fundamental part of any programming language. In this chapter, you discover what they are, how to use them, and what makes JavaScript arrays distinct from arrays in other programming languages. You work with arrays to create lists, order lists, and add and remove items from lists.

ontheweb Don’t forget to visit the website to check out the online exercises relevant to this chapter!

Making a List

The earlier chapters in this book involve working with variables that are standalone pieces of data, such as: var myName = “Chris”, var firstNumber = “3”, and var how ManyTacos = 8. There are often times in programming (and ...

Get Coding with JavaScript 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.