«   Previous tip Next tip   »

Chrome DevTools: Print out a quick stack trace from the Console

Last updated: 30th October 2020
Print out a quick stack trace from the Console

Introduction

You can use the Console Panel method console.trace() to get a quick and easy stack trace to better understand code execution flow.

Try it out

To try this feature, just paste the following JavaScript snippet into your Console Panel:

function a() {
    b()
}

function b() {
    console.trace();
}

a();

You can click on the links within the trace result to navigate to the relevant piece of code.

Notes

Extra notes on the console.trace() feature:

Extra resources

«   Previous tip Next tip   »

Sign up to receive a developer tip, in the form of a gif, in your inbox each week