Comcast interview question

Javascript coding round and more about promise concept.