Created
March 29, 2011 07:42
-
-
Save kirkegaard/891953 to your computer and use it in GitHub Desktop.
Neat way to force setInterval into running the function at start and every two seconds after that
This file contains hidden or 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
| var interv = setInterval((function() { | |
| console.log('DING DING DING'); | |
| return arguments.callee; | |
| })(), 2000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment