DEV Community

Discussion on: Async & await explained in short

Collapse
 
hnicolas profile image
Nicolas Hervé

You can use catch on a promise and it will return another promise.
You can use await on a promise to wait for the result.
So everything is ok with the example, even if with the await keyword you can use a try/catch block to catch the error rejected by a promise.

Collapse
 
lico profile image
SeongKuk Han

Thank you :DD