Console trace()
Example
Show how the code ended up here:
function myFunction() {
myOtherFunction();
}
function
myOtherFunction() {
console.trace();
}
Try it Yourself »
Definition and Usage
The trace()
method displays a trace that show how the code ended up
at a certain point.
Note
When testing console methods, be sure to have the console view visible.
Press F12 to open the console veiw.
Syntax
console.trace(label)
Parameters
Parameter | Description |
label | Optional. A label to give the timer a name. |
Browser Support
console.trace()
is supported in all modern browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | 11 | Yes | Yes | Yes | Yes |