The 2 ways are the same, I think. However, I prefer using async().then().catch()
because It will be easier to read.
Moreover, In case you want to call some async functions one by one, but need to break immediately (don't want the following function continue running) if some error throw. You need to put only 1 catch at the final. In this case, we can't use the first style.
asyncA()
.then((val) => asyncB(val))
.then((val) => asyncC(val))
.then((val) => asyncD(val))
.catch(() => { /* any of asyncA, asyncB, asyncC, asyncD will goes directly here if throwing error })
in the example above. You can see, any of the function async fails, the program will skip the following functions and goes directly to catch.