Is there any method to sleep in javascript in a loop?
<p>For example, there is for loop that I want to sleep for some seconds.</p>

<pre><code>$.each(para.res, function (index, item) {
    Sleep(100);
});
</code></pre>

<p>I know I can use setTimeout or setInterval but both of them are asychronous, the loop will continue, just the function in the setTimeout will run in a few seconds if I do it this way.</p>

<pre><code>$.each(para.res, function (index, item) {
    setTimeOut(function(){do something},1000); 
});
</code></pre>
