15 / 17

How do you convert a callback-based function into a Promise-based function?

You can wrap the callback-based function using the await keyword or Promise constructor, resolving or rejecting the Promise based on the callback's outcome.

javascript
Using async await: