Async/await

PHOTO EMBED

Sun Jul 17 2022 04:31:38 GMT+0000 (Coordinated Universal Time)

Saved by @pycajiqutu #javascript

// we assume this code runs at top level, inside a module
let response = await fetch('/article/promise-chaining/user.json');
let user = await response.json();

console.log(user);
content_copyCOPY

https://javascript.info/async-await