This article talks about the Javascript debugger present in the browser and shows you how to use it.
The first and easiest way to use the browser debugger is to add inside your Javascript the debugger keyword.
Steps:
// code before
debugger;
// code after
You may also add a breakpoint by right clicking on the script line.