O'Reilly logo

CoffeeScript Application Development by Ian Young

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Advanced CoffeeScript Usage

We spent the previous chapter overhauling our application to be more modular and use classes. Now it's time to dig even deeper into CoffeeScript. In this chapter, we'll be looking at some advanced features of the language as well as some ways to use what we already know to write better, cleaner, and more powerful code. Think of this chapter as the gateway to becoming a CoffeeScript power user. We will:

  • Learn about the subtleties of context when invoking methods on objects
  • Learn an incredibly easy way to avoid repeating expensive operations by saving results in object state
  • Learn a helpful idiom for passing lots of options to a function

Getting our context right

Now that we're starting to deal with classes a lot ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required