If you really want to debug - use a debugger
Lots of clues on the forum
While running with vscode debugger attached, use the keyword debugger to instruct the debugger to stop...
debugger
Real debugging...