4 ms·
With async code, there is const c = myAsyncFun() .catch(e => …)
by lovasoa 3y ago
With async code, there is
const c = myAsyncFun()
.catch(e => …)
- WorldMaker 3y agoThat leaves c as Promise which was not the type they were looking for. You'd still have to unwrap the promise and deal with the result or rejection. The easiest way to do that is to use await, and if you are using await you'd be better off using try {} catch {} around the async function than .catch().