Created
July 29, 2010 20:00
-
-
Save demimismo/499077 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
// 1 | |
var Person = function(name) { | |
this.name = name; | |
} | |
// 2 | |
Person.prototype.getName = function() { | |
return this.name; | |
} | |
var thomas = new Person('Thomas'); | |
var amy = new Person('Amy'); | |
thomas.getName(); | |
// 3 | |
thomas.getName.call(amy); | |
// 4 | |
delete Person.prototype.getName; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment