
Eight steps are shown below to illustrate how work is done in a non-programming life.
Step 1: A book is requested from a librarian.
Step 2: The librarian orders the book from the warehouse.
Step 3: The librarian provides a receipt for the request open parenthesis that is, request is pending close parenthesis.
Step 4: Client leaves to do other things.
Step 5: Some time later, workers retrieve the book from the warehouse and deliver it to the librarian.
Step 6: Librarian phones the client and notifies him that the book is available.
Step 7: Client returns.
Step 8: Client leaves with the requested book open parenthesis that is, request is resolved or fulfilled close parenthesis.
Eight steps are shown below to illustrate how work is done using JavaScript.
Step 1: Client JavaScript makes request via fetch function.
Step 2: fetch function orders data from supplied “A” P I U R L.
Step 3: fetch function provides a Promise object for the request open parenthesis that is, request is pending close parenthesis.
Step 4: Client executes other lines of code.
Step 5: Some time later, the “A” P I retrieves the data and delivers it to fetch function.
Step 6: fetch function notifies client that the data response has arrived.
Step 7: Client callback function is then called.
Step 8: The client callback function passes the fetched data open parenthesis that is, request is resolved or fulfilled close parenthesis.
Back