Cambridge Intelligence interview question

How do promises work in JS?