Skip to content

Instantly share code, notes, and snippets.

@troygoode
troygoode / coffee.coffee
Created April 6, 2012 18:44
Prototypal Inheritance
object = (o)->
F = ->
F.prototype = o
new F()
# object to inherit from
parent = name: "Papa"
# the new object
child = object parent