DEV Community

Discussion on: All about Promises and async / await

Collapse
 
aravindballa profile image
Aravind Balla • Edited

An amazing line from @wesbos podcast syntaxfm

await(await(fetch('https://api.github.com/users/wesbos'))).json();
Enter fullscreen mode Exit fullscreen mode
Collapse
 
jrop profile image
Jonathan Apodaca

I personally prefer the following form:

await fetch('https://api.github.com/users/wesbos').then(r => r.json())
Collapse
 
ardennl profile image
Arden de Raaij

That's a gem! I do feel like not everyone would get what's going on here on first glance though!