The debugger statement stops the execution of JavaScript, and calls (if available) the debugging function.
Using the debugger statement has the same function as setting a breakpoint in the code.
Normally, you activate debugging in your browser with the F12 key, and select "Console" in the debugger menu.
Note: If no debugging is available, the debugger statement has no effect.
- - -
We have written this JS code in an HTML file:
<script>
function outer(){
console.log("From outer")
inner()
}
function inner(){
debugger;
console.log("From inner")
alert("Bye")
}
</script>
<body onload="outer()"> </body>
- - -
Following are the screenshots of "Firefox Debugger" when we run this code:
When we would press on "Play" button in "Debugger", it will end on the last "alert()" statement.
Pages
- Index of Lessons in Technology
- Index of Book Summaries
- Index of Book Lists And Downloads
- Index For Job Interviews Preparation
- Index of "Algorithms: Design and Analysis"
- Python Course (Index)
- Data Analytics Course (Index)
- Index of Machine Learning
- Postings Index
- Index of BITS WILP Exam Papers and Content
- Lessons in Investing
- Index of Math Lessons
- Index of Management Lessons
- Book Requests
- Index of English Lessons
- Index of Medicines
- Index of Quizzes (Educational)
Friday, February 12, 2021
Debugger statement in JavaScript
Subscribe to:
Post Comments (Atom)


No comments:
Post a Comment