debuggerstatement behaves like a breakpoint and launches the debugger.
console.log(x)logs the value
console.trace()prints a stack trace to the engine’s console.
The console API provides more debugging help and is documented in more detail in The Console API. Exception handling is explained in Chapter 14.