bhylu.com

Advertisements

JS Timers

Timers schedule a callback for later. Their delay is a minimum wait, not an exact appointment.

Where to run this

This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.

A practical example

JavaScript

console.log("Start");
setTimeout(() => console.log("Later"), 20);
console.log("Now");

What happens

Start and Now appear before Later.