Skip to content

Instantly share code, notes, and snippets.

@jalex19100
Last active November 11, 2015 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalex19100/42fe58a16e414a5a8ce1 to your computer and use it in GitHub Desktop.
Save jalex19100/42fe58a16e414a5a8ce1 to your computer and use it in GitHub Desktop.
Object.prototype.getName = function() {
var funcNameRegex = /function (.{1,})\(/;
var results = (funcNameRegex).exec((this).constructor.toString());
return (results && results.length > 1) ? results[1] : "";
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment