How to run async/await in the browser?

Is there a relatively easy way to implement this design in the browser?

getMovieAsync async function() {
 let response = await fetch('http://www.omdbapi.com/?t=The Matrix');
 let movie = await response.json();
console.log(movie.Title);
}

getMovieAsync();


Passed through Babel (es2015, stage-3), got the code for Node.js
July 9th 19 at 13:23
1 answer
July 9th 19 at 13:25
Solution
In what sense is code for Node.js?

You can rewrite this function using Promise

getMovieAsync function() { 
 fetch('https://www.omdbapi.com/?t=The Matrix')
 .then(response => response.json())
 .then(data => { console.log(data.Title) });
}

getMovieAsync();
code modules var x= require('x') - Josiane3 commented on July 9th 19 at 13:28

Find more questions by tags JavaScript