JavaScript函数/ If语句

时间:2014-09-27 19:37:13

标签: javascript

我不知道我的代码有什么问题,我一直在寻找/尝试解决一段时间。有人可以帮助我!

    var sleepCheck = function(numHours) {
        if (sleepCheck >= 8) {
            return "You're getting plenty of sleep! Maybe even too much!";
        } else {
            return "Get some more shut eye!";
    }
};

sleepCheck(10);

1 个答案:

答案 0 :(得分:3)

if (sleepCheck >= 8) 

应该是

if (numHours >= 8)