JavaScript

Error.prototype.descriptionプロパティ

 編集:2022.08.07 by T.A.

構文
Error.description
Error Error

解説
try{
  E=new Error('Could not parse input');
  throw E;
}catch(e){
  alert(e.description); //表示:undefined
}
try{
  Obj=Test;
}catch(e){
  alert(e.message); //表示:Test is not defined
  alert(e.description); //表示:undefined。¶descriptionは使われていないようだ
}
try{
  E=new Error('エラー発生');
  E.description="説明です";
  throw E;
}catch(e){
  alert(e.message);     //表示:エラー発生
  alert(e.description); //表示:説明です
}

テスト