0

Pretty much as the question asks. I noticed if I await a function that isn't a promise it still works. However I wonder if there are any other implications to await-ing non-promise functions.

Does awaiting a function that isn't a promise cause issues, performance or otherwise?

Zeeno
  • 2,671
  • 9
  • 37
  • 60
  • 5
    If the expression after `await` is not a Promise instance, it's converted to a resolved Promise. If you *know* the function will *never* return a Promise, why would you use `await`? – Pointy Oct 13 '19 at 15:00
  • I'm refactoring old code and noticed some instances of the function call are being called wth await while others simply call it as Normal. And it worked just fine. That's what piqued my curiosity – Zeeno Oct 14 '19 at 15:27

0 Answers0