Here is an example of using XMLHttpRequest to make a GET request to retrieve data from remote API:
Here is an example of using fetch() to make a GET request to retrieve data from a remote API.
Both examples assume that you have an API key stored in a variable called API_KEY.
You can also use fetch() to make other types of HTTP requests, such as POST, PUT, and DELETE, by passing an options object as the second argument. For example:
`fetch()` are asynchronous, which means that the code will not block while the request is being made. Instead, the response will be processed in a callback function or with a promise.