JavaScript 虽没有给出继承的关键字,但是我们依然能够拿出一些好办法实现。
1、原型链继承:
var Base = function()
{
this.level = 1;
this.name = "base";
this.toString = function(){
return "base";
};
};
Base.CONSTANT = "constant";
var Sub = function()
{
};
Sub.prototype = new Base();
Sub.p
[……]阅读全文

