HTML DOM console.trace() method
Example
Trace the call path of a function:
function
myFunction
(
)
{
myOtherFunction
(
)
;
}
function
myOtherFunction
(
)
{
console
.
trace
(
)
;
}
Try it »
Definition and Usage
The console.trace() method is used to display the call path of the currently executing code in the stack.
Tip: During testing of this method, the console needs to be visible (press F12 in the browser to open the console).
Syntax
console.trace(label)
Browser support
The numbers in the table indicate the first browser version that supports this method.
| Method | |||||
|---|---|---|---|---|---|
| console.trace() | Yes | 11 | 10 | 4 | Yes |
Console object