DEV Community

Discussion on: Why to use async & await instead of the Promise class?

Collapse
 
grbolivar profile image
grbolivar

Good article. People just jump at your throat immediately, but all you needed to get your point across was a few lines of code:

let data = await fetch();

Vs

let data;
fetch().then(results => data = results);

Whoever prefers the second way just likes to write more code, not to mention async/await code is less clunky and easier on the eyes, heck, async/await may even result on smaller minified files.