Skip to content

Instantly share code, notes, and snippets.

@hughfdjackson
Created June 2, 2012 21:27
Show Gist options
  • Select an option

  • Save hughfdjackson/2860004 to your computer and use it in GitHub Desktop.

Select an option

Save hughfdjackson/2860004 to your computer and use it in GitHub Desktop.
function Foo() {this.bak = 'bax';}
Object.prototype.bar = 'baz5';
Foo.prototype.bar = 'baz';
Foo.bam = 'ban';
var foo = new Foo();
/*
At this point, the chains are:
Foo -> Function.prototype -> null
foo -> Foo.prototype -> Object.prototype -> null
The following is true:
foo.bar === 'baz'
foo.bam === undefined
foo.bak === 'bax'
*/
/* etc */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment