Skip to content

Instantly share code, notes, and snippets.

@paulbruno
Created March 20, 2012 21:05
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 paulbruno/2141298 to your computer and use it in GitHub Desktop.
Save paulbruno/2141298 to your computer and use it in GitHub Desktop.
Pattern for recursive, "one-off" functions (especially useful for DOM traversal, when not using frameworks, or other similar throw-away recursive front-end tasks).
(function _this (/* your param list here */) {
/// INIT CODE HERE ///
if (/* your condition here */) {
_this(/* your passed params here */);
}
})(/* initial passed params here */);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment