网上有些继承prototype实现上有bug例如:
function base() {this.member = ["dnnsun_Member",2,3,4];
}
var child=function(){
};
child.prototype=new base;
var c1 = new child();
var c2 = new child();
c1.member[1]=333;
alert(c2.member[1]);
结果是: 333
Java, Python, IR, KM, NLP, JS, Web2.0
No comments:
Post a Comment