if (mul == "*"){
save = save.substr(0,save.length-calculate(firstCarry,secondCarry));
secondCarry = firstCarry * secondCarry;
save = save +secondCarry;
}
把 :save = save.substr(0,save.length-calculate(firstCarry,secondCarry));
secondCarry = firstCarry * secondCarry;
save = save +secondCarry; 写一个函数
然后在if(mul=="*"){ }里面调用
如何把这个判断条件里面的内容写成一个函数, 然后再这个判断里面调用
答案:2 悬赏:0 手机版
解决时间 2021-01-03 08:25
- 提问者网友:眉目添风霜
- 2021-01-02 13:17
最佳答案
- 五星知识达人网友:忘川信使
- 2021-01-02 13:33
function saveContent(){
save = save.substr(0,save.length-calculate(firstCarry,secondCarry));
secondCarry = firstCarry * secondCarry;
save = save +secondCarry;
}
if(mul=="*"){
saveContent();
}
save = save.substr(0,save.length-calculate(firstCarry,secondCarry));
secondCarry = firstCarry * secondCarry;
save = save +secondCarry;
}
if(mul=="*"){
saveContent();
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯