const work = () => {
return new Promise(resolve => {
setTimeout(() => resolve('doing work'), 3000);
})
};
const doWork = async () => {
console.log(await work());
};
console.log('before');
doWork();
console.log('after');
To embed this project on your website, copy the following code and paste it into your website's HTML: