0

Is there any way to know when to use Promises vs Async/Await?

I am asking that because it's not so clear for me to know which one performs better, or also is better readable, is there any advantages using each one of them or it doesn't matter?

Thanks!

Danilo
  • 19
  • 2

2 Answers2

1

They are the same, async/await is a syntactic sugar for promises.

Titouan56
  • 6,932
  • 11
  • 37
  • 61
1

They are exactly the same, so it all comes down to you preference. If you are using a framework, I'd recommend you use the way they use in the framework for consistency.

Roban Reuvers
  • 216
  • 2
  • 9