Chapter 5. Composing objects

This chapter covers

  • Structuring code with classes and inheritance
  • Using prototypes for dynamic flexibility
  • Extending your program with mixins

In the previous chapter you traveled the road from object literals to prototypes and then classes. Along the way you started to build an understanding of how objects work in CoffeeScript. Now it’s time to reverse course by first defining some classes of your own and then slowly taking them apart to see the objects and prototypes that underpin them. This will give you the complete picture of objects in CoffeeScript.

You’ll begin the exploration with classical objects and class inheritance, followed by methods and other class properties and an explanation of the super ...

Get CoffeeScript in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.