O'Reilly logo

JavaScript: 20 Lessons to Successful Web Development by Robin Nixon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required