Junior JavaScript

What is a promise chain?

Promise chaining allows multiple async tasks to run sequentially.

Example:

fetch('/data')

.then(res => res.json())

.then(data => console.log(data))

.catch(err => console.error(err));

More from JavaScript Tutorial

All questions for this course