Outputs a stack trace to the Web Console.
Note: This feature is available in Web Workers.
See Stack traces in the console
documentation for details and examples.
Syntax
console.trace();
Example
function foo() { function bar() { console.trace(); } bar(); } foo();
In the console, the following trace will be displayed:
bar foo <anonymous>
Specifications
Specification | Status | Comment |
---|---|---|
Console API The definition of 'console.trace()' in that specification. |
Living Standard | Initial definition |
Browser compatibility
See also
Document Tags and Contributors
Tags:
Contributors to this page:
arronei,
valtlai,
erikadoyle,
teoli,
fscholz,
ClompenSander,
Sebastianz,
chrisdavidmills,
cvrebert,
BrokenEnso,
nwwells,
kscarfone,
Khodaidad_Basharmand,
Luke314,
Sheppy,
ziyunfei
Last updated by:
arronei,