await async

This commit is contained in:
Ken
2019-02-15 20:13:29 -08:00
parent 4b0492a81a
commit 988aea6c1d
7 changed files with 128 additions and 8 deletions

View File

@@ -0,0 +1,8 @@
async function fetchSomething() {
const response = await fetch('http://localhost:3000/hello');
return await response.text();
}
fetchSomething().then(text => {
console.log('hello ' + text);
});