Debug javascript tips

Costas

Administrator
Staff member
The debugger statement invokes any available debugging functionality, such as setting a breakpoint. If no debugging functionality is available (aka F12), this statement has no effect.

JavaScript:
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger
function potentiallyBuggyCode() {
    debugger;

    if (this.User == null)
    .
    .
    .
}

 
 


Debug Typescript into VSCode
https://code.visualstudio.com/docs/typescript/typescript-debugging

 
 


nodeJS remote debugging
JavaScript:
//src - https://github.com/nodejs/node/issues/23693

navigate @:
chrome://inspect/#devices

Open dedicated DevTools for Node
 
 

webpack - casual by F12
xnpBy2q.png

 
 

Dont forget, when replacing functions with arrow functions expression (also known as fat arrow function) can access this!!
 
Top