Introduction
setTimeout lets you run a task after waiting some time. clearTimeout stops that task if you change your mind.
You want to show a message after 3 seconds.
You want to delay a function to avoid running it too fast.
You want to cancel a delayed action if the user clicks a button.
You want to schedule a reminder but allow canceling it.
You want to simulate waiting for something in a simple way.