Call function in itself in callback : <p>i am not quite sure that Title related to my problem, so sorry.</p>

<p>I have asynchronous function that call callback function. So the main idea is I want to call function "dodo" each time after "asyncFunc" is done.</p>

<p>Are there some patterns for that? Are there issues releated to memory leak ?</p>

<pre><code>var can = true;
function dodo() {
    if(can)
    {
        can = false;
        asyncFunc(function(data) {
            doSmth();
            can = true;
        });
    }

}
setInterval(dodo, 0);
</code></pre>
