var test=function(){ return new Promise((resolve, reject) => { setTimeout(()=>{ resolve('dkljalkfjakfj') },3000) }); }; async function test2(){ var data=await test(); console.log(data); } test2()