Fetch API in JavaScript

The fetch() method starts the process of fetching a resource from a server.

The fetch() method returns a Promise that resolves to a Response object.

The fetch API is modern method that allows you to make HTTP requests to servers from web browsers.

The fetch API returns the data as a promise, and we can use then and catch method on that promise to handle the data.

Please refer following video to understand the execution in proper way,

Thanks to Procademy.