SOURCE

const promise = new Promise((resolve, reject) => {
    setTimeout(() => {
        // resolve('success')
        reject('error')
    }, 1000)
})
promise.then(
    (result) => {
        console.log(result,'成功')
    },
    (error) => {
        console.log(error,"失败")
    }
)
console 命令行工具 X clear

                    
>
console