3 ms·
You probably can, but you may as well just do this instead: const json = await fetch('https://api.github.com/orgs/facebook').then(res => res.json());
by dvlsg 10y ago
You probably can, but you may as well just do this instead:
const json = await fetch('https://api.github.com/orgs/facebook').then(res => res.json());
- ludamad 10y agoI think the await code is more explicit, whereas a callback is somewhat ambiguous
- nathancahill 10y agoI'll be glad to do away with callbacks completely tbh.