📌  相关文章
📜  return new Promise(res => { - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:09.380000             🧑  作者: Mango

代码示例1
// the execution: catch -> then
new Promise((resolve, reject) => {

  throw new Error("Whoops!");

}).catch(function(error) {

  alert("The error is handled, continue normally");

}).then(() => alert("Next successful handler runs"));