Created
January 21, 2011 16:31
-
-
Save GeertVL-zz/789929 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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