Tutorial by Examples

CoffeeScript provides a basic class structure that allows you to name your class, set the superclass, assign prototypal properties, and define the constructor, in a single assignable expression. Small example below: class Animal constructor: (@name) -> move: (meters) -> alert @n...
If you feel the need to extend an object's prototype, :: gives you quick access to an it so you can add methods to it and later use this method on all instances of that method. String::dasherize = -> this.replace /_/g, "-" The above example will give you the ability to use the da...

Page 1 of 1