3 COMPOUND DATA TYPES

In the previous chapter we discussed JavaScript’s primitive data types, which represent a single piece of data, like a number or a string. Now we’ll look at JavaScript’s compound data types, arrays and objects, which combine multiple pieces of data into a single unit. Compound data types are an essential part of programming because they allow us to organize and work with collections of data of any size. You’ll learn how to create and manipulate arrays and objects, and how to combine them into more complex data structures.

Arrays

A JavaScript array is a compound data type that holds an ordered list of values. The elements ...

Get JavaScript Crash Course 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.