function AA() {
}
function BB() {
}
var x = BB.prototype
console.log(x === BB.prototype); //true
BB.prototype = new AA()
// new操作符创建、继承、返回一个新对象(假设为o,存在o.__proto__=AA.prototype)
console.log(x === BB.prototype); //false
function AA() {
}
function BB() {
}
var x = BB.prototype
console.log(x.constructor);
BB.prototype = new AA()
console.log(BB.constructor);
console.log(BB.prototype.__proto__ === AA.prototype);
console.log(x.constructor);
function AA() {
}
var o = {}
AA.prototype = o
console.log(AA.prototype.hasOwnProperty('constructor')); //false
console.log(AA.prototype.__proto__.hasOwnProperty('constructor')); //true; constructor:Object
console.log(AA.constructor === Function);//Function ???
console.log(AA.constructor); //Function ???
//为什么不是Object???
https://github.com/mqyqingfeng/Blog/issues/2