Skip to content

Instantly share code, notes, and snippets.

@mkuklis
Created June 17, 2011 06:19
Show Gist options
  • Save mkuklis/1030949 to your computer and use it in GitHub Desktop.
Save mkuklis/1030949 to your computer and use it in GitHub Desktop.
lazy function definition pattern in JavaScript
var doThisDoThat = function () {
console.log("do this");
doThisDoThat = function () {
console.log("do that");
};
};
doThisDoThat() // do this
doThisDoThat() // do that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment