Skip to content

Instantly share code, notes, and snippets.

@anddoutoi
Created November 13, 2013 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anddoutoi/7449619 to your computer and use it in GitHub Desktop.
Save anddoutoi/7449619 to your computer and use it in GitHub Desktop.
Run time lookup
function A() {
this.name = 'A';
}
A.prototype.log = function () {
console.log( 'A', this );
};
var a = new A();
a.log();
A.prototype.log = function () {
console.log( 'B', this );
};
a.log();
a.constructor.prototype.log = function () {
console.log( 'C', this );
};
a.log();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment