-
-
Save FireyFly/1291370 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Talkable = { | |
talk: function(){ | |
return this.name + ': ' + this.speech() | |
} | |
} | |
var Animal = Object |> { | |
trait Talkable, | |
name: 'Animal', | |
get speech() '...' | |
} | |
var Cat = Animal |> { | |
name: 'Cat', | |
get speech() 'meow' | |
} | |
var nyan = Cat |> { name: 'Nyan nyan nyan' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment