Mid JavaScript

Explain the concept of promises and async flow.?

A Promise represents a value that may be available now, later, or never.

It helps handle asynchronous operations in a cleaner way.

Follow me on LinkedIn:

Example:

fetch('/data')

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

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

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

✅ async/await simplifies promise syntax.

More from JavaScript Tutorial

All questions for this course