Skip to content

Instantly share code, notes, and snippets.

@cloud8421
Created June 29, 2011 09:01
Show Gist options
  • Save cloud8421/1053479 to your computer and use it in GitHub Desktop.
Save cloud8421/1053479 to your computer and use it in GitHub Desktop.
setTimeout and anonymous functions
If you want to run an anonymous function inside a setTimeout, just do:
setTimeout ( -> alert 'Hello world' ), 3000
Which will result in:
setTimeout((function() {
return alert('Hello world');
}), 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment