I need to make this code return a promise. Idk how to do that and i wanna learn. If you can, i would also need some explications, thanks!
var url = "....";
function showMoviesList(callbackFunction){
fetch(url + "/movies", {
method: "GET",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
}
}).then(function(response){
return response.json();
}).then(function(moviesArray){
callbackFunction(moviesArray);
});
}