Skip to content

Instantly share code, notes, and snippets.

@mynyml
Created January 16, 2011 22:43
Show Gist options
  • Save mynyml/782227 to your computer and use it in GitHub Desktop.
Save mynyml/782227 to your computer and use it in GitHub Desktop.
class Foo
@bar: -> 'bar'
# baz: -> Foo.bar()
baz: -> @constructor.bar()
class Boo extends Foo
@bar: -> 'moo'
console.log Boo.bar() #=> "moo"
console.log new Boo().baz() #=> "moo" (would have been "bar" with baz: -> Foo.bar())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment