debugger 문은 중단점(break point) 설정과 같이 사용할 수 있는 디버깅 기능을 호출합니다. 사용할 수있는 디버깅 기능이 없으면 이 코드는 동작하지 않습니다.
구문
debugger;
예제
다음 예제에서는 함수가 호출 될 때 debugger statement(있는 경우)을 호출하기 위해 디버거 문을 삽입 한 코드를 보여줍니다.
function potentiallyBuggyCode() {
debugger;
// do potentially buggy stuff to examine, step through, etc.
}
디버거가 호출되면 디버거 문에서 실행이 일시 중지됩니다. 이것은 스크립트 소스의 중단 점과 같습니다.
명세
| Specification | Status | Comment |
|---|---|---|
| ECMAScript Latest Draft (ECMA-262) The definition of 'Debugger statement' in that specification. |
Draft | |
| ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Debugger statement' in that specification. |
Standard | |
| ECMAScript 5.1 (ECMA-262) The definition of 'Debugger statement' in that specification. |
Standard | Initial definition |
| ECMAScript 3rd Edition (ECMA-262) The definition of 'Debugger statement' in that specification. |
Standard | |
| ECMAScript 1st Edition (ECMA-262) The definition of 'Debugger statement' in that specification. |
Standard | Only mentioned as reserved word. |
브라우저 호환성
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
debugger | Chrome Full support 5 | Edge Full support 12 | Firefox Full support 1 | IE Full support 4 | Opera Full support Yes | Safari Full support Yes | WebView Android Full support 1 | Chrome Android Full support 18 | Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support 1.0 | nodejs Full support Yes |
Legend
- Full support
- Full support
