Summary

In this chapter, we learned all about classes in CoffeeScript. We saw:

  • How to define and instantiate classes
  • How to attach properties and methods to classes, and how to call them internally with @
  • How to attach static properties and methods to the class object itself
  • How to use constructors to perform initialization for the class
  • How to use CoffeeScript classes in Ember.js and Backbone.js
  • How CoffeeScript implements all this using JavaScript's prototype system

Now that we know almost everything there is to know about CoffeeScript classes, we're ready to put this knowledge into practice. The next chapter is going to be all about using classes to create modular, maintainable, understandable code. We're going to return to our pet shop application ...

Get CoffeeScript Application Development 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.