If总是给我最后的结果
检查这个片段
function calc(on, ep, am, ek, b1, b2, b3, b4) {
var sum, mo;
b1 = parseInt(b1);
b2 = parseInt(b2);
b3 = parseInt(b3);
b4 = parseInt(b4);
sum = b1 + b2 + b3 + b4;
mo = sum / 4;
if (mo < 5) {
x = "Not Good";
}
if (mo < 6, 5 && mo > 4, 99) {
x = "Good";
}
if (mo < 8, 5 && mo > 6, 49) {
x = "Really Good";
}
if (mo > 8, 49) {
x = "Perfect";
}
alert("O " + on + " " + ep + " " + am + " who is in " + ek + "th semester had avereged " + mo + " " + x);
}
我不能让它与其他如果或类似的东西一起工作,但我需要它工作,但它是
JavaScript 浮点文字使用.
字符(U + 002E:FULL STOP)作为小数点,而不是,
字符(U + 002C:COMMA)(这是逗号运算符).