Created
June 29, 2011 09:01
-
-
Save cloud8421/1053479 to your computer and use it in GitHub Desktop.
setTimeout and anonymous functions
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
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