Chapter 10. Arrays Made Easy

This chapter covers

  • Working with JavaScript arrays
  • Understanding Prototype’s functional approach to arrays
  • Extending arrays and hashes using the Enumerable mixin

We’ve covered the most common language features now, namely the Object and the Function. Using these, we can easily organize our data and invoke operations on it. In the previous two chapters, we’ve already seen how Prototype makes it easier to work with these features in a meaningful way.

There is a third element that is almost as fundamental to most programming languages, and that is the array. Arrays can be used to organize data into lists, and recursively into more complex structures. JavaScript supports arrays through the Array object in a powerful ...

Get Prototype and Scriptaculous in Action 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.