ES5组合继承方案(首选)
1 | var Parent = function (name, age) { |
ES5寄生组合继承方案(候选)
1 | var Parent = function (name, age) { |
ES6的class实现继承方案(首选)
1 | class Parent { |
class扩展阅读参考(伪多态等)
1 |
|
1 | var Parent = function (name, age) { |
1 | var Parent = function (name, age) { |
1 | class Parent { |
1 |
|