Chapter 4. Classes

In the previous chapter, we learned about JavaScript's object implementation and discovered how ideas from both prototypal and classical languages were incorporated into the language. This merging of approaches is somewhat unique to the language and sometimes makes it harder for new developers to learn how object-oriented programming in JavaScript works.

MooTools, with its focus on modularity and simplicity, provides an elegant alternative to the native implementation. To put it succinctly, MooTools turns JavaScript into a classical language. In this chapter, we'll learn how this class system works, and we'll examine some of the techniques used by MooTools to add a major language feature to JavaScript.

From Prototypes to Classes ...

Get Pro JavaScript with MooTools: Learning Advanced JavaScript Programming 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.