The fetch() method in JavaScript is used to request to the server and load
the information on the webpages. The request can be of any APIs that return
the data of the format JSON or XML.
This method returns a promise.
fetch('http://example.com/movies.json')
.then((response) => response.json())
.then((data) => console.log(data));