我在哪里错?我想先递增firstNumber,然后再求和结果2。我尝试调试,但出现错误“未定义x”
function main() {
let object = {
firstNumber: 1,
sum: 0
}
secFun(x, object, firstFun)
console.log(object.sum)
}
function firstFun(a) {
a.firstNumber++;
a.sum += a.firstFun;
}
function secFun(x, y, callback) {
callback(x, y);
}
main();
x
。