1 # disallow the use of `debugger` (no-debugger)
3 The `debugger` statement is used to tell the executing JavaScript environment to stop execution and start up a debugger at the current point in the code. This has fallen out of favor as a good practice with the advent of modern debugging and development tools. Production code should definitely not contain `debugger`, as it will cause the browser to stop executing code and open an appropriate debugger.
7 This rule disallows `debugger` statements.
9 Example of **incorrect** code for this rule:
12 /*eslint no-debugger: "error"*/
14 function isTruthy(x) {
20 Example of **correct** code for this rule:
23 /*eslint no-debugger: "error"*/
25 function isTruthy(x) {
26 return Boolean(x); // set a breakpoint at this line
32 If your code is still very much in development and don't want to worry about stripping `debugger` statements, then turn this rule off. You'll generally want to turn it back on when testing code prior to deployment.
36 * [Debugger](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger)
40 * [no-alert](no-alert.md)
41 * [no-console](no-console.md)