誰かがこの再帰関数の出力を説明できますか? ありがとうございました!
function test(a) {
while (a > 0) {
a -= 1;
test(a);
console.log('after first invocation: ' + a);
}
}
test(3);
出力:
after first invocation: 0
after first invocation: 1
after first invocation: 0
after first invocation: 2
after first invocation: 0
after first invocation: 1
after first invocation: 0