Files
coffeescript/documentation/sections/prototypal_inheritance.md
Geoffrey Booth d1d2c16fdd Update docs for classes, breaking changes (#4438)
* Update classes docs for CS2

* Port breaking changes from https://github.com/jashkenas/coffeescript/wiki/%5BWIP%5D-Breaking-changes-in-CoffeeScript-2 into new docs section

* Update browser compiler

* Update re @connec’s notes; split classes section into two sections for classes and working with prototypes; make breaking changes examples editable whenever possible
2017-02-09 08:50:11 -08:00

361 B
Raw Blame History

Prototypal Inheritance

In addition to supporting ES2015 classes, CoffeeScript provides a few shortcuts for working with prototypes. The extends operator can be used to create an inheritance chain between any pair of constructor functions, and :: gives you quick access to an objects prototype:

codeFor('prototypes', '"one_two".dasherize()')