javascript setTimeout() not working

This line:

setTimeout(startTimer(), startInterval); 

You’re invoking startTimer(). Instead, you need to pass it in as a function to be invoked, like so:

setTimeout(startTimer, startInterval);

Leave a Comment