【发布时间】:2011-06-03 23:44:30
【问题描述】:
我敢打赌,通过从jc.half = jc.half(); 中删除部分,以下情况会更有效。我只是不太确定如何。
jc.half = function(){
if(jc.singlerow){
return jc.total
}else{
return jc.total / 2;
}
}
// returns function()
jc.half = jc.half();
// returns the right integer
我正在寻找这样的解决方案:
jc.half = returnInteger(function(){
if(jc.singlerow){
return jc.total
}else{
return jc.total / 2;
}
})
// returns the right integer
【问题讨论】:
标签: javascript variables integer