Skip to content

📚 5.catch

💻 代码实现

typescript
// 实现catch函数
Promise.prototype._catch = function (callback) {
    this.then(undefined, (err) => callback(err))
}

Released under the MIT License.