Hacker News new | past | comments | ask | show | jobs | submit login

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());



I think the await code is more explicit, whereas a callback is somewhat ambiguous


I'll be glad to do away with callbacks completely tbh.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: