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
andBackbone.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 and do some serious refactoring.