IPD Analytics interview question

How do javascript promises work?