Created
January 29, 2012 03:04
-
-
Save island205/1696937 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
class HanJiaJun | |
### | |
相当于JS中的构造函数 | |
### | |
constructor:(@name)-> | |
console.log "I am HanJiaJun!" | |
### | |
原型方法 | |
### | |
write:(title)-> | |
"Original Article '#{title}' form #{@name}" | |
class HanHan extends HanJiaJun | |
constructor:()-> | |
### | |
相当于使用arguments直接apply父类的构造函数 | |
### | |
super | |
write:(title)-> | |
"A Copy of #{super(title)}" | |
console.log new HanHan("hanhan").write("人造方舟子") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment