It helps in debugging when an unexpected error/output appears.Syntax
1) Open your browsers inspect element window before pressing run() button.
2) When the statement marked for debugging execute, the execution will be paused and waits for user action.
3) You can then execute the lines one by one, by pressing F10 button. We can see how the values are assigned and executed.
Our in-build editor does not support debugger in firefox, so create an 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.