A Pez dispenser with a Tweety Bird head

As I’ve previously discussed, arrays are variables with infinite “slots” for data. These slots can be filled from all kinds of sources: selections of DOM elements, random numbers, text, etc. It’s very common to loop over this data to perform some operation, but it’s also common to extract or insert more data, or to trim the array. That’s what push, pop, shift and unshift are for.

A droplet of water rebounding from rippled water

As web pages become more complex and user interfaces deeper, trying to track events with individual event listeners presents a very real problem of scale, as each added button demands more coding. Thankfully, has a built-in event system that, with a little bit of planning, can make development far easier.