Skip to content

Instantly share code, notes, and snippets.

Created July 2, 2011 14:04
Show Gist options
  • Select an option

  • Save anonymous/1060356 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/1060356 to your computer and use it in GitHub Desktop.
Prototype question
function A() {
this.sayFoo = function() {
console.log("foo");
};
}
A.prototype.sayFoo = function() {
console.log("bar");
};
function init() {
var a = new A();
a.sayFoo();
delete a.sayFoo;
a.sayFoo();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment