2024-08-23[Javascript] Covert async code to sync code with throwing Promiseconstfetch=()=>newPromise((res)=>{setTimeout(()=>res({user:'zhen'}),1150)})globalThis.fetch=fetchasyncfunctiongetUser(){returnawaitfetch()}asyncfunctionm1(){//dosomethingreturnawaitge