scrimba
setInterval: the timed loop
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

setInterval: the timed loop
AboutCommentsNotes
setInterval: the timed loop
Expand for more info
index.js
run
preview
console
/* Example: delaying loops with setInterval */
let isDressed = false
setTimeout(() => isDressed = true, 5000)


/* effectively an infinite loop - do not run */
while (!isDressed) {
console.log("Get dressed!")
}
Console
/index.html
-5:16