可以通过 ANSI转义码 来输出不同颜色, 更多请查看ANSI介绍示例console.log('\x1B[31m%s\x1B[0m', '前景色')console.log('\x1B[107m%s\x1B[0m', '背景色')颜色参考
toString 方式Object.prototype.toString.call(val) === '[object Object]' // true 代表为对象注意:这里要使用 call 方法改变作用域constructor 方式val?.constructor === Obje
一般情况下 async/await 在错误处理方面,主要使用 try/catch,像这样const fetchData = () => { return new Promise((resolve, reject) => { setTimeout(() => {