Created
January 22, 2014 17:47
-
-
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.
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
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