how to make functions with setTimeout() work in sequence?
<p>Let's say I have 4 functions, every each of them has loops inside working with <code>setTimeout()</code>. How do I make those functions to run in sequence and not overlap? That is, how do I make each of them execute just after previous one is finished?</p>

<pre><code>function1();
function2();
function3();
function4(); 
</code></pre>
