Here's some code to show the problem:
In function foo() there is an error: Variable oops is not declared. The code that use the promise will however swallow that error.
By using setTimeout we can get out from the context of the promise, so we can see errors again.
With this knowelage we can now create a function that turns a Promise into a function.
(I have not tested the above function so there might be edge cases)
Async functions takes a while to master, but Promises are still async functions - only more complicated.
Written by Johan Zetterberg December 12th, 2020.