Skip to content

Instantly share code, notes, and snippets.

@mason-stewart
Created April 1, 2011 18:50
Show Gist options
  • Save mason-stewart/898639 to your computer and use it in GitHub Desktop.
Save mason-stewart/898639 to your computer and use it in GitHub Desktop.
It doesn't get anymore exciting that this.
function AwesomeBand(name) {
this.name = name;
}
AwesomeBand.prototype.name = 'Iron Maiden';
var band = new AwesomeBand('Ke$ha');
band.name; //prints 'Ke$ha'
band.__proto__.name; //prints 'Iron Maiden'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment