console.trace()
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.
構文
js
trace();
trace(object1, /* …, */ objectN);
引数
objects
省略可-
スタックトレースと共にコンソールに出力する 0 個以上のオブジェクトです。これらは
console.log()
メソッドに渡したのと同じ方法で構成され書式化されます。
返値
なし (undefined
)。
例
js
function foo() {
function bar() {
console.trace();
}
bar();
}
foo();
コンソールには次のようなトレースが表示されます。
bar foo <anonymous>
仕様書
Specification |
---|
Console # trace |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
trace() 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.