THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML DOM console.trace() Method

❮ Console Object

Example

Show the trace of how the code ended up here:

function myFunction() {
  myOtherFunction();
}

function myOtherFunction() {
  console.trace();
}
Try it Yourself »

Definition and Usage

The console.trace() method displays a trace that show how the code ended up at a certain point.

Tip: When testing console methods, be sure to have the console view visible (press F12 to view the console).


Browser Support

The numbers in the table specify the first browser version that fully supports the method.

Method
console.trace() Yes 11 10 4 Yes

Syntax

console.trace(label)

❮ Console Object