scrimba
Frontend Career Path
Working with APIs
Async JS
Callbacks - revisiting setTimeout
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

Callbacks - revisiting setTimeout
AboutCommentsNotes
Callbacks - revisiting setTimeout
Expand for more info
index.js
run
preview
console
function handleClick() {
fetch("https://apis.scrimba.com/deckofcards/api/deck/new/shuffle/")
.then(res => res.json())
.then(data => console.log(data))
}

document.getElementById("new-deck").addEventListener("click", handleClick)

/**
* Challenge:
*
* Part 1: write a `setTimeout` command. Have it wait for 2000 ms before logging "I finally ran!" to the console
*
* Part 2: Upcoming...
*/
Console
/index.html
-4:10