Dimebox interview question

How do promises work in JS?