Skip to content

Instantly share code, notes, and snippets.

@lyuehh
Created December 31, 2013 15:19
Show Gist options
  • Save lyuehh/8198253 to your computer and use it in GitHub Desktop.
Save lyuehh/8198253 to your computer and use it in GitHub Desktop.
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