Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

aysnc and await response data usage

async function fetchMoviesJSON() {
  const response = await fetch('/movies');
  const movies = await response.json();
  return movies;
}
fetchMoviesJSON().then(movies => {
  movies; // fetched movies
});
Source by dmitripavlutin.com #
 
PREVIOUS NEXT
Tagged: #aysnc #await #response #data #usage
ADD COMMENT
Topic
Name
6+3 =