3 ms·
Pretty much... all you need to provide to `await` is an object with a 'thenable' function. Even this works: (async () => { const promise = { then (
by mattwad 5y ago
Pretty much... all you need to provide to `await` is an object with a 'thenable' function. Even this works:
(async () => {
const promise = {
then (resolve) {
resolve('World');
}
};
console.log('Hello', await promise);
})()