Tray.ai interview question

Convert a function with a callback in a promise