scrimba
Frontend Career Path
Working with APIs
Async JS
Promises - .then() chaining
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

Promises - .then() chaining
AboutCommentsNotes
Promises - .then() chaining
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)

const promise = fetch("https://apis.scrimba.com/deckofcards/api/deck/new/shuffle/")
// .then(res => res.json())
// .then(data => console.log(data))
Console
/index.html
-3:25