codecamp

JavaScript if语句

// 举例
function ourFunction(isItTrue) {
if (isItTrue) { 
return "Yes, it's true";
}
return "No, it's false";
}


// Setup
function myFunction(wasThatTrue) {


// Only change code below this line.
if(wasThatTrue){
  return "That was true";
}
  return "That was false";
// Only change code above this line.


}


// Change this value to test
myFunction(true);
JavaScript 布尔boolean数据类型
JavaScript 等于比较运算符==  
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定