一个Js的问题

function Foo(){
this.age = 3;
}

Foo.prototype = {
getAge : function(){
return this.age;
}
}

var o1 = new Foo();

此时o1.constructor已经是Object,那么为什么下面这行代码还返回true呢?

o1 instanceof Foo

或者说,instanceof 是根据什么做的判断呢?

posted @ 2014-05-31 11:29  cnbwang  阅读(68)  评论(0)    收藏  举报