var obj={
name:'obj',
size:0,
describe:function (){
return 'nothing';
}
};
undefined
typeof obj.prototype;"undefined"//为什么这里是"undefined"........................................................................
function Person(name){
this.name=name;
}
undefined
Person.prototype.describe=function (){
return 'Person named: '+this.name;
};
ƒ (){
return 'Person named: '+this.name;
}
var a=new Person('a');
undefined
Person.prototype instanceof Object;
true
typeof Person.prototype;"object"//为什么这里是"object"Person.prototype===Object.create(Person.prototype);
false//为什么这里是false问题插入代码了,为什么第一处typeof是"undefined",第二处是"object";为什么最后一处是false
添加回答
举报
0/150
提交
取消