Apply your JS skills to key Mozilla projects as an MDN Fellow! http://mzl.la/MDNFellowship

mozilla

Revision 417099 of debugger

  • Revision slug: Web/JavaScript/Reference/Statements/debugger
  • Revision title: debugger
  • Revision id: 417099
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment JavaScript/Reference/Statements/debugger Web/JavaScript/Reference/Statements/debugger

Revision Content

Summary

Invokes any available debugging functionality. If no debugging functionality is available, this statement has no effect.

Version Information

Statement
Implemented in JavaScript 1.0
ECMAScript Edition ECMA-262 5th Edition

Syntax

debugger;

Examples

The following example shows code where a debugger statement has been inserted, to invoke a debugger (if one exists) when the function is called.

function potentiallyBuggyCode() {
    debugger;
    // do potentially buggy stuff to examine, step through, etc.
}

Revision Source

<h2 id="Summary" name="Summary">Summary</h2>

<p>Invokes any available debugging functionality. If no debugging functionality is available, this statement has no effect.</p>

<h2 id="Version_Information">Version Information</h2>
<table class="standard-table">
  <tbody>
    <tr>
      <td class="header" colspan="2">Statement</td>
    </tr>
    <tr>
      <td>Implemented in</td>
      <td>JavaScript 1.0</td>
    </tr>
    <tr>
      <td>ECMAScript Edition</td>
      <td>ECMA-262 5th Edition</td>
    </tr>
  </tbody>
</table>

<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox"><code>debugger;</code></pre>

<h2 id="Examples" name="Examples">Examples</h2>

<p>The following example shows code where a debugger statement has been inserted, to invoke a debugger (if one exists) when the function is called.</p>

<pre class="brush:js">
function potentiallyBuggyCode() {
    debugger;
    // do potentially buggy stuff to examine, step through, etc.
}</pre>

<!-- Old Data-->
<!--languages({
"zh-cn": "zh-cn/JavaScript/Reference/Statements/debugger"
})-->
Revert to this revision