Using a One-Off Timer with setTimeout3:26 with Andrew Chalkley
In this video we'll explore one-off timers with the `setTimeout` function.
callback is a function and
delay is the number of milliseconds until the callback is invoked.
Canceling a Timeout
To cancel a timeout before the callback is executed assign the timeout to a variable and call the
const timeoutID = setTimeout(callback, delay); //Clears the timeout immediately clearTimeout(timeoutID);
You need to sign up for Treehouse in order to download course files.Sign up