When is a Promise rejected?


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


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.