codecamp

JavaScript else语句

function myTest(val) {
var result = "";
// Only change code below this line


if (val > 5) {
result = "Bigger than 5";
}


else {
result = "5 or Smaller";
}


// Only change code above this line
return result;
}


// Change this value to test
myTest(4);
JavaScript 使用逻辑或运算符||比较数值
JavaScript else if语句
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定