摘要:
每个函数内部有2个特殊对象(this、arguments)、每个函数都包含2个属性(length、prototype)、每个函数都包含2个非继承而来的方法(apply、call) 阅读全文
posted @ 2012-06-05 11:23
WFKeypoints
阅读(159)
评论(0)
推荐(0)
摘要:
function inheritPrototype(subType, superType){
var prototype = object(superType.prototype); //create object
prototype.constructor = subType; //augment object
subType.prototype = prototype; //assign object
} 阅读全文
posted @ 2012-06-05 09:49
WFKeypoints
阅读(608)
评论(0)
推荐(0)
摘要:
function Person(name, age, job){
//properties
this.name = name;
this.age = age;
this.job = job;
//methods
if (typeof this.sayName != "function"){
Person.prototype.sayName = function(){
alert(this.name);
};
}
} 阅读全文
posted @ 2012-06-05 09:43
WFKeypoints
阅读(163)
评论(0)
推荐(0)

浙公网安备 33010602011771号