let p = new Promise((resolve, reject) => { //1. resolve 函数 resolve('ok'); // pending => fulfilled (resolved) 成功状态 //2. reject 函数 reject("error");// pending => rejected 失败状态 //3. 抛出错误 throw '出问题了'; //失败状态 }); console.log(p);