© Russ Ferguson 2019
Russ FergusonBeginning JavaScripthttps://doi.org/10.1007/978-1-4842-4395-4_4

4. JavaScript Objects and Arrays

Russ Ferguson1 
(1)
Ocean, NJ, USA
 

The last chapter introduced variables. Using variables, you can save information to use later. As applications become more complex, the ability to remember user settings, URLs, or the contents of a form becomes more important.

One of the problems that you run into with a variable is, no matter the type, you can only hold onto one piece of information at a time. If you assign a new value to a variable, the original value is gone. This prevents you from holding onto complex types of data.

It is also not reasonable to create a large number of variables for the purpose of simulating something ...

Get Beginning JavaScript: The Ultimate Guide to Modern JavaScript Development 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.