reading-notes

JS Debugging

Error Handling & Debugging

 

ORDER OF EXECUTION

 

EXECUTION CONTEXTS

The JavaScript interpreter uses the concept of execution contexts. There is one global execution context; plus, each function creates a new new execution context. They correspond to variable scope.

 

Code Debugging

Programming code might contain syntax errors, or logical errors.

 

JavaScript Debuggers

Debugging is not easy. But fortunately, all modern browsers have a built-in JavaScript debugger.

 

The console.log() Method

If your browser supports debugging, you can use console.log() to display JavaScript values in the debugger window

 

The Setting Breakpoints

In the debugger window, you can set breakpoints in the JavaScript code.

 

The debugger Keyword

 

Major Browsers’ Debugging Tools

Normally, you activate debugging in your browser with F12, and select “Console” in the debugger menu.

Chrome

Firefox

 

 

 

Summary