title: Countdown timer pause/resume functionality javascript
body: <p>I have implemented pause functionality, but for the life of me can't wrap my head around the resume functionality. The way this app is coded the seconds variable is reset to the value of the input. I think I have stared at this too long and cannot think of how to establish a resume feature.</p>
  
  <pre><code>    let seconds;
      let timer;
      let isRunning = false;
  function start(){
          isRunning = !isRunning;
          if(isRunning == true) {
          seconds = document.getElementById("input").value;
          document.getElementById('count-down').innerHTML = seconds;
          timer = setInterval(check, 1000);
          } else {
              pause();
          }
      };
      function pause () {
          clearInterval(timer);
          timer = null;
      }
  function check() {
      if(seconds &lt;= 0 ) {
          clearInterval(timer);
          document.getElementById('body').style.backgroundColor = "#80bfff";
      } else {
          seconds--;
          document.getElementById('count-down').innerHTML = seconds;
      }
  };
  &lt;/script&gt;
      &lt;div id = "timer"&gt;
          &lt;div id="header"&gt;
              &lt;p&gt;Timer&lt;/p&gt;
          &lt;/div&gt;
          &lt;div id="body"&gt;
              &lt;p id="count-down"&gt;&lt;/p&gt;
              &lt;p class="inline"&gt;Enter time(in seconds)&lt;/p&gt;
              &lt;input class="inline" type="text" id="input"&gt;
              &lt;button type="button" onclick="start()"&gt;Start&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>