Images

Pushing to and Popping from Arrays

image

         To view the accompanying video for this lesson, please visit mhprofessional.com/nixonjavascript/.

In addition to assigning values to an array when you create it or adding those values using numeric indexes or associative keys, you can simply push items of data onto an array and pop them off later. When doing this, you don’t need to keep track of an index number or any key names; you simply push a value and forget about it until you want to pop it back off the array later.

This makes it very easy to store ...

Get JavaScript: 20 Lessons to Successful Web 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.