Skip to content

Instantly share code, notes, and snippets.

@meandmax
Last active August 29, 2015 14:06
Show Gist options
  • Save meandmax/fd63095871bb81bbf1fa to your computer and use it in GitHub Desktop.
Save meandmax/fd63095871bb81bbf1fa to your computer and use it in GitHub Desktop.
Coffee examples
# initializing the parent class with a value defined by the child class
class a
constructor: (valA = 1, valB = 2, valC = 3, valD = 'parent') ->
@func(valD)
func: (val) ->
console.log(val)
class b extends a
constructor: (valA, valB, valC, valD) ->
childValue = 'child'
super(valA, valB, valC, childValue)
# do something childspecific
c = new b()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment