async function fn(){ console.log(111) function sleep(){ return new Promise( resolve => { setTimeout(resolve, 1000) }) } await sleep() console.log(222) } fn()