Some sample JavaScript code snippets for:
- Sending a request to a web server with the Fetch API.
- Working with the Response object.
- Working with the Promise object for chaining multiple requests.
- Handling server status codes.
Instructions for use
- the web page containing the JavaScript code.
- Open the page in Brave or other, lesser web browsers.
- View the JavaScript output by pressing the following keys and selecting the Console tab:
- Ctrl + Shift + i (Windows)
- ⌘ Command + Shift + i (Mac).
- Open the web page in VS Code, VS Code Online or Sublime Text. All are good choices.
- Play around with the JavaScript code. Change things and see what happens.
✅ That’s it.