Skip to content

Instantly share code, notes, and snippets.

@grumpit
Created May 25, 2012 17:10
Show Gist options
  • Save grumpit/2789253 to your computer and use it in GitHub Desktop.
Save grumpit/2789253 to your computer and use it in GitHub Desktop.
Exercise for JS Master Class
var Person = function(name) {
this.name = name;
}
Person.prototype.getName = function() {
return this.name;
}
var thomas = new Person('Thomas');
var amy = new Person('Amy');
thomas.name;
thomas.getName();
Person.prototype.getName = function() {
return 'Amy';
}
delete Person.prototype.getName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment