snipt

Ctrl+h for KB shortcuts

JavaScript

Anonymous setTimeout

1
2
3
4
(function foo() {
    doStuff();
	setTimeout(foo, 100);
}());
https://snippets.siftie.com/embed/81ba3325f8b592d80de78b1a4b3cd317/
/raw/81ba3325f8b592d80de78b1a4b3cd317/
81ba3325f8b592d80de78b1a4b3cd317
js
JavaScript
4
2019-03-19T21:27:42
True
False
False
/api/public/snipt/38803/
anonymous-settimeout
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="p">(</span><span class="kd">function</span> <span class="nx">foo</span><span class="p">()</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nx">doStuff</span><span class="p">();</span> </span><span id="L-3"><a name="L-3"></a> <span class="nx">setTimeout</span><span class="p">(</span><span class="nx">foo</span><span class="p">,</span> <span class="mi">100</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="p">}());</span> </span></pre></div> </td></tr></table>
setTimeout