scrimba
JS Deep Dive
Async JS
Challenge: async-await
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

Challenge: async-await
AboutCommentsNotes
Challenge: async-await
Expand for more info
index.js
run
preview
console
// Challenge: 
// Rewrite the GET API call from the previous challenge using async-await


// Challenge:
fetch('https://jsonplaceholder.typicode.com/users/3')
.then(response => {
if (!response.ok) {
throw new Error(response.status);
}

return response.json()
})
.then(person => console.log(`${person.name} works for ${person.company.name}`))
.catch(err => console.error(err))

Console
"Clementine Bauch works for Romaguera-Jacobson"
,
/index.html
-2:42