var Class = {
create:function()
{
return function(){ this.initialize.apply(this,arguments);}
}
}
var Person = Class.create();
Person.prototype = {
initialize:function(name,sex){ this.name = name; this.sex = sex;},
toString:function(){ return "the name is " + this.name + " and sex is " + this.sex}
}
var zhangsan = new Person("zhangsan","male");
alert(zhangsan.toString());
浙公网安备 33010602011771号