Debugging JavaScript code in browsers
JavaScript code is executed in the browser. We (as developers) use intelligent IDEs, intelligent test frameworks, and so on to build an application easily. But sometimes, when the browser executes our intelligently-built code, something we didn't expect happens, and our code breaks.
Bugs can be syntax errors. These kinds of bugs are easy to determine. Most IDEs have some built-in tools to determine syntax errors, and even provide smart fixes.
Some bugs are logical errors. These kinds of bugs aren't easy to determine, yet most IDEs have no support to determine logical errors.
So, we need tools to debug our code in the execution environment, namely, the browser.
Note
The example project can be found at https://github.com/polatengin/B05277/tree/master/Chapter18/5-GettingStartedDebugging.
Getting ready
All browsers have an inner mechanism that understands and executes JavaScript code. This mechanism is called the JavaScript Engine.
The main job of a JavaScript Engine...