What are the differences between callbacks, promises, async/await? Aren't they essentially the same?
Panda Quests

Panda Quests @pandaquests

About: Hi, °(p.q)° I'm pandaquests. I mainly write about software engineering and working in IT. https://pandaquests.medium.com/membership

Location:
Munich/Germany
Joined:
Sep 19, 2019

What are the differences between callbacks, promises, async/await? Aren't they essentially the same?

Publish Date: Nov 4 '20
2 3

Comments 3 total

  • Fernando B 🚀
    Fernando B 🚀Nov 4, 2020

    They're not the same, promises tried to make callbacks easier to chain. Then async/await tried to make promises even easier, by adding syntactic sugar. Essentially all deal with asynchronous code.

  • shadowtime2000
    shadowtime2000Nov 5, 2020

    async/await is essentially easier promises.

    const foo = async (num) => num + 1;
    // Is the same as
    const foo = (num) => Promise.resolve(num + 1);
    
    Enter fullscreen mode Exit fullscreen mode

    With the difference between Promises/async/await and callbacks, callbacks are less readable.

Add comment