Home / Javascript Tips Generated By ChatGPT / Clearing a Timeout with clearTimeout in Javascript Cancel a timeout set with setTimeout using clearTimeout. Source Code let timerId = setTimeout(() => console.log("This won't run."), 1000); clearTimeout(timerId);