What is the use of debugger keyword in JavaScript?
Answers (1)
Add AnswerThe JavaScript debugger keyword places a breakpoint in the code. The debugger halts the program’s execution at the point where it is applied. We can now manually begin the execution flow. If an exception occurs, the execution will come to a halt again on that line. Consider the following scenario:
function display() { x = 10; y = 15; z = x + y; debugger; document.write(z); document.write(a); } display();