7. Promise.reject
Sunny-117 opened this issue · comments
/**
* 得到一个被拒绝的Promise
* @param {*} reason
*/
Promise.reject=function(reason) {
return new MyPromise((resolve, reject) => {
reject(reason);
});
}
Promise.reject = function (data) {
return new Promise((resolve, reject) => {
reject(data);
});
};