why the setInterval method gets 10 as input variable?

Viewed 44

my stopwatch with javascript and I don't get this point

buttonStart.addEventListener("click", () => {
  if (Interval) {
  clearInterval(Interval); }
 Interval = setInterval(startTimer, 10);  });
1 Answers

The second value it receives is the number of milliseconds between repetitions. Meaning each 10 milliseconds it will run the startTimer function.

Related