It helps in debugging an unexpected error/output appears.Syntax
1) Keep open your browsers inspect element window before pressing run() button.
2) When the debugger statement execute, the execution will be paused and wait for user action.
3) You can then execute the lines one by one by pressing F10 button. We can see the how the values are assigned and execute.
Our in-build editor does not support debugger in firefox, so create a separate .html file and enter the following codes. Then you can debug your code in firefox.
Without entering the debugger keyword we can place the debugger point during runtime without reloading the web page.
Browsers doesn't support run time debugger in our in-build editor. Save the following program in a separate .html file and try the above steps.