Welcome back! If you missed Part 1, check it out here!
Consider the Fetch API Instead of jQuery Ajax. Also, Be Aware of Failed to Fetch
The fetch API is the latest standard for making asynchronous calls in the browser. It’s very nice in that it uses the Promise API and provides a much cleaner experience for the developer. See MDN for an overview. We use this GitHub repo in which we have wrapper functions to call fetch where we generically type the calls and verify authentication.