我有这种情况:
function f1(a) {
a = f2(a);
// do some other stuff
console.log("I don't want the function f1 to log this.")
}
function f2(a) {
if (a == null) {
console.log("enters here")
return;
}
return a;
}
f1(null)
如果a为空,我不想f1继续使用console.log(). 我可以改变什么来获得这种行为?(我知道我可以用一些来做到这一点,booleans但我想知道是否有另一种方法来解决这个问题)
慕桂英3389331
慕后森
MYYA
相关分类