Skip to content

Instantly share code, notes, and snippets.

@ehynds
Created January 14, 2011 15:51
Show Gist options
  • Save ehynds/779771 to your computer and use it in GitHub Desktop.
Save ehynds/779771 to your computer and use it in GitHub Desktop.
calling a fn immediately and later
var foo = (function f(){
return f;
})(); // do this immediately
// then later:
foo();
function foo(){}
foo(), setInterval(foo, 1000); // immediately & later on an interval
// LAME
function foo(){}
foo(); // immediately
foo(); // then later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment