Skip to content

Instantly share code, notes, and snippets.

@GeertVL-zz
Created January 21, 2011 16:31
Show Gist options
  • Save GeertVL-zz/789929 to your computer and use it in GitHub Desktop.
Save GeertVL-zz/789929 to your computer and use it in GitHub Desktop.
<script>
var Person = function(name) {
this.name = name;
this.getName = function() {
return this.name;
};
}
var thomas = new Person('Thomas');
var amy = new Person('Amy');
console.log(thomas.getName());
thomas.getName = function() { return amy.getName() };
console.log(thomas.getName());
delete Person.prototype.getName;
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment