Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    what's the point of awaiting a non-async function? If cannotFail function contains an async code that is callback-based, you can wrap a promise around it and return that promise from the cannotFail function. Commented Jul 12, 2021 at 16:30
  • 1
    you can actually await a non-promise, the await just does nothing. May be useful if something may or may not return a Promise dependant on some condition. Commented Jul 12, 2021 at 16:32
  • Async is not the same as try catch and has less to do with failing/non failing functions. It is for asynchronous code. Your function will run very well, but you do not need an await. Remove that and it is still the same. Maybe you want to ask something else? Commented Jul 12, 2021 at 16:36