javascript 对象继承图
2017-01-17 14:49:13 8 举报
Javascript中的对象继承原理
作者其他创作
大纲/内容
constructor
Age=30
__proto__
Object()
注:personA.Name=undefined personA.Age=30
Object
prototype
Function()
Person
personA:new Person()
Father
function Person(){}; Person.Name = \"ren\";Person.prototype.Age=30;var personA = new Person();function Father(name){ this.Name=name;};
Person.prototype
function Person(){}; Person.Name = \"ren\";Person.prototype.Age=30;var personA = new Person();function Father(name){ this.Name=name;};Father.prototype= personA;//new Person();Father.prototype.constructor = Father;var fatherA = new Father()
Function
Father.prototype
Javacript中最重要的两个对象Object和Function
Name=\"ren\"
function Person(){}; Person.Name = \"ren\";Person.prototype.Age=30;
原始对象 Object
X
fatherA:new Father()
function Person(){}; Person.Name = \"ren\";Person.prototype.Age=30;var personA = new Person();
注:这里没有__proto__
收藏
0 条评论
下一页