Debug by Print Statement Alert Box
Still, it worked well enough. despite being slow and painfully annoying; however, more recently, several browsers have implemented consoles which can record logging statements. Because it does not interrupt the code as it’s being run, it’s a lot better than debug by alert box, but ultimately, it’s still debug by print statement.
Microsoft Visual Studio
Then there’s Visual Studio.
Perhaps the finest IDE in the world offers a simple way to step through your code, examine the value of variables, and treat your scripting code like it was C#, VB.NET, or C++. All you need to do is add this statement to your code wherever you would like a breakpoint:
Make sure your project is in Debug mode, press the Start Debugging button and execute your script file in a browser.
When the script file hits the debugger line, it will break into Visual Studio and you can look at variable values, Step In, Step Over and Continue to your heart’s content.
There you go!Happy debugging!