Inspector调试
Vs Code
cmd中输入node --inspect-brk debug.js意思是使程序在入口的地方停下来
function test1() {
const a=parseInt(Math.random()*10);
const b=parseInt(Math.random()*10);
const c=test2();
}
function test2(a,b) {
if(a>b){
a+=a*2;
}else {
b-=a
}
return a+b;
}
test1();
cmd输入:
F:\nodeFile\part1>node --inspect-brk debug.js
Debugger listening on ws://127.0.0.1:9229/031e17ac-d650-4fd7-99d9-c33641810f15
For help see https://nodejs.org/en/docs/inspector