I\'m writing some recursive JavaScript code which also uses timeouts. The purpose is to wait a bit, execute some code, then call the function again:
function