Skip to content

Instantly share code, notes, and snippets.

@hansv
Created October 19, 2010 19:31
Show Gist options
  • Select an option

  • Save hansv/634902 to your computer and use it in GitHub Desktop.

Select an option

Save hansv/634902 to your computer and use it in GitHub Desktop.
var Person = function(name) {
this.name = name;
};
Person.prototype.getName = function() {
return this.name
};
thomas.getName() // --> "Thomas"
thomas.getName.call(amy); // --> "Amy"
delete Person.prototype.getName
thomas.getName()
//TypeError: Result of expression 'thomas.getName' [undefined] is not a function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment