title: setInterval to play sound once
body: <p>I currently have some Javascript which checks every second (using set interval) if a ticking time value is below 1 hour and if true appends the class "warning" to a html element. </p>
  
  <p>I would also like to have a sound play when the time value goes below 1 hour.</p>
  
  <p>I currently have the below:</p>
  
  <pre><code>var snd = new Audio("sound.wav");
  var x = setInterval(function() {
      if (distance &lt; 3600000 ) { 
      timer.className = "warning" ;
      playSound();
      }
      },1000);
  
  function playSound() {
      snd.play;
      }
  </code></pre>
  
  <p>The problem I have is that once the time value goes below 1 hour (3600000 ms) it plays the sound every second as it is a part of my setinterval which checks the time each second. How do I get it to only play the once?</p>