When is a Promise rejected?

Question

In the context of this exercise, when is a Promise rejected?

Answer

A Promise is “rejected” in two main cases. They are because either an Error is thrown or because a Promise.reject(reason) is returned, which is a Promise object with the given reason for the rejection.