Javascript debuggers

From wikinotes
Revision as of 15:42, 22 February 2024 by Will (talk | contribs) (→‎Example)

A debugger is builtin to your browser console.

Documentation

MDN: debugger https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger

Example

// add to your code, this is your breakpoint
// (you may need the dev tools/console visible for it to trigger)
debugger;

// show stacktrace
console.trace();