title: Why javascript setTimeout is not working and setInterval working for the below program
body: <p>I am trying execute a test number slider program, I found that <code>setTimeout</code> is not working and <code>setInterval</code> is worked for the below program. I don't understand why this is happened.
  Please help me. </p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;h1 id="slide"&gt;&lt;/h1&gt;
  
      &lt;/body&gt;
      &lt;script type=text/javascript&gt;
  
      (function(){
         var i=0,
             numbers = [10,20,30,40,50,60],
             intervalTime = 3000;
          return {
              init:function(){
                  console.log(numbers[i] +"-"+ i);
                 document.getElementById("slide").innerHTML = numbers[i];
                if(i &lt; numbers.length - 1) 
              i++;
             else
                     i=0; 
  
             setTimeout(this.init,intervalTime); 
                 //setInterval(this.init,intervalTime); 
  
  
              }
  
          };      
  
      }()).init();
  
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>