If you’ve ever used JavaScript’s setTimeout
and setInterval
methods. you’ve probably found them just a bit … inadequate.
- Both return an integer rather than an actual handle.
- If you’re using both
setTimeout
andsetInterval
, you have to remember whether the integer value is a timeout or an interval in order to call the appropriateclearXXX
method.