title: Simple issues with setInterval
body: <p>so sorry for a basic qn like this. This is my simple JS code to do a timer. I was hoping to print the countdown number periodically. I tested the rest of the code and it seems to work, however it gives me sth weird when I add the setInterval command. I am not sure why. I hence seek an explanation and how to correct it.
  Also, when it works, the new reloaded number should replace the old number right. For instance when 4 appears, it simply replaces 5 during the countdown. </p>
  
  <p>Code:</p>
  
  <pre><code>var x = prompt("Time till take off");
  
  
  
  function printTimer (){
    document.write(x)
  }
  
  while (x &gt; 0) {
  
    setInterval(printTimer,1000)
    x = x -1;
  }
  
  if (x=1){
    document.write("Rocket taken off")}
  </code></pre>
  
  <p>Thanks! </p>