Skip to content

Instantly share code, notes, and snippets.

Created October 28, 2010 15:32
Show Gist options
  • Save anonymous/651596 to your computer and use it in GitHub Desktop.
Save anonymous/651596 to your computer and use it in GitHub Desktop.
Prototype initialization
function SomeConstructor() {
this.foo = function() {
// This *overrides* any "foo" set up in the prototype object
};
}
SomeConstructor.prototype = {
foo: function() {
// will never be called by any instance created with SomeConstructor
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment