Fetch() takes a URL that contains data as an argument and returns the object of that data. In other words, fetch() makes a network request and uses Promises for that. The example looks like that :
fetch(“URL you want to use”)
Because fetch() is using promises, we have to call then() method to the stored object and transform it into a response that can be manipulated. In this function, we can do any processing we need but we must make sure that its response is converted by using json() built-in function and returned.For example :
.then(response => response.json())
After that, we should use final .then method on the object that we got from fetch() and add DOM manipulations to it.