我是JS codecademy课程的初学者。超级基础,我知道。它一直告诉我意外的令牌,如果我一直试图调试这几个小时。请帮忙?提前谢谢!
var sleepCheck = function(numHours)
if (numHours >= 8) {
return "You're getting plenty of sleep! Maybe even too much!";
}
else {
return "Get some more shut eye!";
}
答案 0 :(得分:4)
var sleepCheck = function(numHours){
if (numHours >= 8) {
return "You're getting plenty of sleep! Maybe even too much!";
}
else {
return "Get some more shut eye!";
}
}
你错过了{}
的
答案 1 :(得分:2)
您的功能似乎没有用花括号包裹。
var sleepCheck = function(numHours){
if (numHours >= 8) {
return "You're getting plenty of sleep! Maybe even too much!";
}
else {
return "Get some more shut eye!";
}
}
应该有效。 欢迎!