Created
December 31, 2013 15:19
-
-
Save lyuehh/8198253 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Foo() {} | |
// Foo.prototype 是Object的一个实例 | |
console.log(Foo.prototype.__proto__ === Object.prototype); | |
console.log(Foo.prototype.constructor === Foo); | |
var f1 = new Foo(); | |
// f1是Foo的一个实例 | |
console.log(f1.__proto__ == Foo.prototype); | |
console.log(f1.__proto__.constructor === Foo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment