what's the difference between javascript timeout and timer methods
<p>JS support timeout and timer. Here is their definition:</p>

<p>timeout - repeat execution of a code within specific time and it returns an integer that can be used to cancel pending timeout.</p>

<pre><code>var timeout_id = setTimeout(f,500);
cleartTimeout(timeout_id);
</code></pre>

<p>timer - repeat exectuion of code at specific interval.</p>

<pre><code>id = setInterval(F,5000);
clearInterval(id)
</code></pre>

<p>I am a little confused, what is their difference?    </p>
