I'm learning React API. Promise and async are using this. and...
I found promise, async MDN docs, but I can't understand "async in somefunction always return promise object"
function sleep(ms){
return new Promise( resolve => setTimeout(resolve, ms));
}
async function process(){
console.log('hi');
await sleep(1000);
console.log('hello');
}
process().then(() => {
console.log('end')
})