DEV Community

Sudarsan
Sudarsan

Posted on

10

How I am Handling Promises - Traditional way vs Modern way

Handling Promises are very hard now a days, but there’s an easy way to deal it!

Traditional Way: so many then and catch blocks 🥴

old way of handling promises

Modern Way: With the help of async and await we can get rid of then and catch blocks and improves code readability! 🥳

modern way of handling promises

Comment your thoughts and share to your friends

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay