how to set the timeoute number to a variable setinterval code example
Example: js setinterval vs settimeout
var intervalID = setInterval(alert, 1000); // Will alert every second.
// clearInterval(intervalID); // Will clear the timer.
setTimeout(alert, 1000); // Will alert once, after a second.