Javascript / typescript debug options

Date: 2024-04-23

Source: https://raygun.com/learn/javascript-debugging-tips

if (yourCondition) {    
    debugger; // This statement pauses the debugger while devtools is open
}

debug(car.funcY) // Type this in the console and the script will stop in debug mode when it gets a function call to car.funcY

monitor(funcY) // Type this in the console to output function calls and arguments

// To time a function
console.time('Timer1');
var items = [];
for(var i = 0; i < 100000; i++){
   items.push({index: i});
}
console.timeEnd('Timer1');
84540cookie-checkJavascript / typescript debug options