I'm using React and i need to store some Api requests into variables so that i could do some modifications.
I want to do something like this :
function getMovies() {
var moviesArr = '';
return fetch('https://api.themoviedb.org/3/movie/now_playing?api_key=4344343' +
'd61a2e5')
.then((response) => response.json())
.then((json) => moviesArr = json);
}
const currentMoviesArray = getMovies() // Then to recieve the movies data
So the const currentMoviesArray will finally bring me back the fetched data