DEV Community

Discussion on: Simplify JavaScript Promises

Collapse
 
sunnysingh profile image
Sunny Singh

Definitely more concise!

I think there is something to be said about how a .then reads a bit better, but this can be argued both ways. Either example takes advantage of the language to do one thing: fetch data.

In most scenarios, you would have a helper function anyway, which is essentially what you wrote (I would just rename it to something like fetchUsers()).