SOURCE

// 模拟异步请求
const sleep = (isSuccess) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      if (isSuccess) {
        resolve("success");
      } else {
        reject("failure11");
      }
    }, 1000);
  });
};

const getRes1 = async () => {
  const res1 = await sleep(false).then(res=>{
      return res
  }).catch(err=>{
      return 111
  });
  // Promise 返回 reject ,底下的代码块不被执行
  console.log(res1,"do something...");
};

getRes1();
console 命令行工具 X clear

                    
>
console