JavaScript Promise デザインパターン - reduce を使った可変長非同期逐次処理 , キャンセル可能なPromise など - Promise の中では throw してはならない このコードは何が表示されるだろうか? new Promise((resolve)=>{ setTimeout(()=>{ throw new Error("foo"); resolve("bar"); }); }) .then((a)=>{ alert(a); }) .catch((err)=>{ alert(err); });