Junior JavaScript

What is async/await?

async/await makes asynchronous code look synchronous.

It works with Promises.

Follow me on LinkedIn:

Example:

async function fetchData() {

const data = await fetch("/api");

return data.json();

More from JavaScript Tutorial

All questions for this course