Ajax (also spelled AJAX) stands for Asynchronous JavaScript and XML. These days, however, you're more likely to work with JSON than XML, so the name is a bit misleading. On to code: take a look at 
API calls from the frontend – Ajax
Figure 4.7 – SWAPI Ajax result
Congratulations! You've made your first Ajax call! Let's break down the following code:
fetch('https://swapi.co/api/people/1/')
.then((response) => {
return response.json()
})
.then((json) => {
console.log(json)
})
fetch is a fairly new API in ES6 that essentially replaces the older, more complicated way of making Ajax calls with XMLHttpRequest. As you can see, the syntax is fairly concise. What might not be obvious is the role that the .then() functions play—or even...