Skip to content

Instantly share code, notes, and snippets.

@jalex19100
Created January 22, 2014 17:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalex19100/8563569 to your computer and use it in GitHub Desktop.
Save jalex19100/8563569 to your computer and use it in GitHub Desktop.
Self-Destruct JavaScript function - executes the contents of the function once, but does nothing on any subsequent calls. Pretty straightforward.
var selfDestructMessage = function(element) {
// Do some stuff
selfDestructMessage = function(element) { /* Replace myself with an empty block */ }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment