console.error()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
console.error()
メソッドは、エラーメッセージをウェブコンソールに出力します。
メモ: この機能はウェブワーカー内で利用可能です。
構文
js
error(obj1);
error(obj1, /* …, */ objN);
error(msg);
error(msg, subst1, /* …, */ substN);
引数
obj1
…objN
-
出力する JavaScript オブジェクトのリスト。 各オブジェクトの文字列表現が記述順で出力されます。
msg
-
0 個以上の置換文字列 (substitution strings) を含む JavaScript 文字列です。
subst1
…substN
-
msg
内の置換文字列を置換する JavaScript オブジェクト。これにより、出力の書式の詳細な制御が可能となります。
詳細については、console
ドキュメント内のコンソールへのテキストの出力を参照してください。
返値
なし (undefined
)。
仕様書
Specification |
---|
Console # error |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error() static method |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.