Comment

Comment by Jakob

Re stopping timers: The timer id is afaik just a steadily increasing number starting at 1 which is returned by setTimeout() so you can iterate through them, e.g. to stop all:

  for (let i=1; i++; i<=setTimeout('')) {
    clearTimeout(i);
  }
Though that’s an implementation detail which could change in the future since the spec seems to not enforce it.
parent Jakob 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton