![]() | 1 qiukun 2012-12-15 12:49:14 +08:00 哪有类继承 |
![]() | 5 yqyq1020 OP @synzhang 我看到网上有很多的标题是js的类式继承和原型继承,讲的好像是两种继承方式,但我看了代码没有看出有什么区别,似乎就是用prototype原型来模拟其他语言中的类式继承,请问是不是这样的 |
![]() | 7 chone 2012-12-15 19:59:41 +08:00 js原生的是原型继承,类继承是模拟出来的。 |
![]() | 8 watana 2012-12-15 20:48:00 +08:00 《Javascript Patterns》 > Often you hear the term "classical inheritance" in discusstions on ... > ... > The term is just a play on the word "class". 当时看到这句话,原来老美也会玩弄文字。。 |
![]() | 9 duhastmich 2012-12-16 10:03:56 +08:00 @yqyq1020 可以看一下coffeescript的extends是怎么实现的 |