原创@前端司南
虽然Promise是开发过程中使用非常频繁的一个技术点,但是它的一些细节可能很多人都没有去关注过。...我们都知道,.then, .catch, .finally都可以链式调用,其本质上是因为返回了一个新的Promise实例,而这些Promise实例现在的状态是什么或者将来会变成什么状态,很多人心里可能都没个底...is: ', value)
}, reason => {
console.log('rejection of the returned promise occurred, and the reason...', value)
}, reason => {
console.log('rejection of the returned promise occurred, and the reason...('rejection of the returned promise occurred, and the reason is: ', reason)
})
如果.catch(onRejected)的