SOURCE

let p = new Promise((resolve, reject)=>{
    setTimeout(_=>{
        resolve(200)
        // console.log('resolve后继续..')
    }, 1000)
    //reject的本质是把状态改成rejected,并抛出一个错误
    reject({
        err:'rejected'
    })
   
})

let q = p.then(()=>{
    console.log('success ----')
})

q.catch(e=>console.log(e))
console 命令行工具 X clear

                    
>
console