Created
February 9, 2012 04:47
-
-
Save sgentile/1777385 to your computer and use it in GitHub Desktop.
Coffeescript static property and method
This file contains hidden or 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
class Person | |
@test: (input) -> | |
return input | |
@staticProperty : 10 | |
@get: -> | |
return {name:'Steve'} | |
nonStatic: -> | |
return "non static" | |
console.log Person.test 'Hello World' | |
console.log Person.get() | |
console.log Person.staticProperty | |
#console.log Person.nonStatic() this is an error | |
person = new Person() | |
console.log person.nonStatic() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment