HTML DOM console.trace() Method

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

The HTML DOM console.trace () method is used to display the stack trace upto the point the console.trace () method has been called upon. It is basically used for displaying the code path i.e how the code ended up at that point.