这样写为什么不是输出两次bye
new Promise ( (resolve, reject) => { setTimeout( () => { reject('bye') },2000) }) .then( value => { console.log(value);}, error => { console.log(error) }) .catch( error => { console.log(error);})
只输出一次,那这个是then里输出的还是catch里输出的呢?
new Promise ( (resolve, reject) => { setTimeout( () => { reject('bye') },2000) }) .then( value => { console.log(value);}, error => { console.log(error) }) .catch( error => { console.log(error);})
只输出一次,那这个是then里输出的还是catch里输出的呢?
2018-07-15
举报