非同期の関数 ( async ) では返り値が Promise
となるので、直接返り値を利用できない
then で結果が出たことを待ち受けて、その中で関数の返り値を利用する
functionsleep(ms){returnnewPromise(resolve=>setTimeout(resolve,ms));}asyncfunctionf(){awaitsleep(1000);return"XXX";}constresult=f()console.log(result)// Promise { <pending> }f().then(result=>{console.log(result)});// XXX