How setTimeout works
Let’s step through what just happened.
When the page loads we do two things: we define a handler named timerHandler, and we call setTimeout to create a time event that will be generated in 5000 milliseconds. When the time event happens, the handler will be executed.
The browser continues its normal job as the timer counts down in milliseconds.
what is the difference between setTimeout, setInterval, and cleanInterval functions?