mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
await async
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user