console.log(Box.prototype.isPrototypeOf(obj)); 原型对象判断为什么返回false
JS代码:
function Box(){} Box.prototype.name = 'Lee'; Box.prototype.age = 100; Box.prototype.run = function(){return this.name + this.age + 'yuin'; }; var box1 = new Box(); var box2 = new Box(); var obj = new Object(); console.log(Object.prototype.isPrototypeOf(box1)); //trueconsole.log(Box.prototype.isPrototypeOf(obj)); //false
完整问题请点击:
http://www.dreawer.com/question/09c011ca1094440b9cc2d8c2c81719e3