function Person (){
this.head = new Head();
this.eye = new Eye();
}
function Head(){
this.headId = "";
}
function Eye(){
this.eyeId = "";
}
...全文
1426打赏收藏
关于javascript自定义类的疑问
有没有直接这样用, 是否应该使用继承,怎么用 function Person (){ this.head = new Head(); this.eye = new Eye(); } function Head(){ this.headId = ""; } function Eye(){ this.eyeId = ""; }