
JavaScript else if语句
function myTest(val) {
if (val > 10) {
return "Greater than 10";
}
else if (val < 5) {
return "Smaller than 5";
}
else{
return "Between 5 and 10";
}
}
// Change this value to test
myTest(7);
function myTest(val) {
if (val > 10) {
return "Greater than 10";
}
else if (val < 5) {
return "Smaller than 5";
}
else{
return "Between 5 and 10";
}
}
// Change this value to test
myTest(7);