Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
CoffeeScript removes the rather verbose function statement, and replaces it with a thin arrow: ->. Functions can be one-liners or indented on multiple lines. The last expression in the function is implicitly returned. In other words, you don’t need to use the return statement unless you want to return earlier inside the function.
With that in mind, let’s take a look at an example: