Pergunta de entrevista da empresa Outlier Technologies

Refactor this JavaScript snippet to use promises rather than callbacks.