如下一个原型对象:
function Box(){}
Box.prototype = {
country : 'China',
method : function(){
return this.country;
}
};
var box1 = new Box();
var box2 = new Object();
var a = Box.prototype;
var b = box1.__proto__;
alert(a.isPrototypeOf(box1)); //返回false
alert(b.isPrototypeOf(box1)); //返回true
1、指针与对象引用是等价的吗?
2、变量a存储的是指针还是对象引用?
3、b呢?
4、a与b有什么区别?如果是等价的,为何alert(a.isPrototypeOf(box1))返回false,而alert(b.isPrototypeOf(box1))返回ture?
5、box1和box2具体有什么区别?
谢谢!