➕await
turns Promise (future value) into a value/error.
// works only inside async functions❗️
let value = await promise;// when top-level await not supported, use async IIFE instead.
(async () => {
let value = await promise;
// ...
})();Last updated