pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Error/message

ipt>

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

Error: message

Baseline 広く利用可能

この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2015年7月以降、すべてのブラウザーで利用可能です。

messageError インスタンスのデータプロパティで、人間が読めるエラーの説明です。

文字列で、Error() コンストラクターの最初の引数として渡された値に対応します。

Error: message のプロパティ属性
書込可能
列挙可能不可
設定可能

解説

このプロパティは、利用可能または設定されている場合、エラーの簡潔な説明を含みます。 message プロパティは name プロパティとの組み合わせで、Error の文字列表現を生成するために Error.prototype.toString() メソッドにより使用されます。

既定で message プロパティは空文字列ですが、この振る舞いは、 Error コンストラクターの第一引数としてメッセージを指定することにより、インスタンスを上書きできます。

独自のエラーを発生させる

js
const e = new Error("Could not parse input");
// e.message is 'Could not parse input'
throw e;

仕様書

仕様書
ECMAScript® 2027 Language Specification
# sec-error.prototype.message

ブラウザーの互換性

関連情報

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy