Understanding async/await on NodeJS

前端 未结 4 2059
醉话见心
醉话见心 2020-11-30 09:33

I think my understanding of it might be affected by my experience with .NET\'s async/await, so I\'d like some code example:

I\'m trying

4条回答
  •  粉色の甜心
    2020-11-30 09:56

    You can await any promise in an async function. The code after the await will be executed after the promise that you are awaiting finished.

    This is a great alternative to classic JavaScript callbacks.

    I wrote a blog about it -> https://github.com/Gameye/js-async I hope this will help you!

提交回复
热议问题