function Animal(){
}
function Cat(){
Animal.call(this);
}
function extend(Parent, Child){
var F = function(){};
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
Child.super = Parent.prototype;
}
console.log(Object.contructor == Function); //true
console.log(String.contructor == Function); //true
console.log(Function.contructor == Function); //true
function Foo(){}
var bar = {};
var a = new Foo();
console.log("bar.constructor : " + bar.constructor);
console.log("bar.prototype : " + bar.prototype);
console.log("bar.__proto__ : " + bar.__proto__);
console.log("a.constructor : " + a.constructor);
console.log("a.prototype : " + a.prototype);
console.log("a.__proto__ : " + a.__proto__);
console.log("Foo.constructor : " + Foo.constructor);
console.log("Foo.prototype : " + Foo.prototype);
console.log("Foo.__proto__ : " + Foo.__proto__);
console.log("Function.constructor : " + Function.constructor);
console.log("Function.prototype : " + Function.prototype);
console.log("Function.__proto__ : " + Function.__proto__);
console.log("Object.constructor : " + Object.constructor);
console.log("Object.prototype : " + Object.prototype);
console.log("Object.__proto__ : " + Object.__proto__);
Object.prototype是鸡,Object和Function都是蛋。