Promise.resolve(1) .then((res) => { console.log(res) return 2 }) .catch((err) => { return 3 }) .then((res) => { console.log(res) })
1,2
then 和catch都返回的是promise, 为什么没有输出3呢,因为没有错误,没有触发catch
← CENTOS7下安装REDIS promise在循环中的串行并行用法→