4 ms·
Someone please correct me if I’m wrong, but I’m pretty sure await has to be within an async function [0]. [0] https://github.com/tc39/ecmascript-asyncawait/iss
by thomasfoster96 10y ago
Someone please correct me if I’m wrong, but I’m pretty sure await has to be within an async function [0].
[0] https://github.com/tc39/ecmascript-asyncawait/issues/36 https://github.com/tc39/ecmascript-asyncawait/issues/36
- Klathmon 10y agoYeah but we can use the same "trick" we've been using for years, an IIFE: (async () => { // Code... })()