Internal Error: Too Much Recursion


Im getting an error (Internal Error: Too much recursion). Can anybody please help!

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



You are calling sleepCheck function inside itself and you can't do that. Replace sleepCheck with numHours (the optional parameter of the function)


Thanks miniapple8888, that I have another issue..that will not let me pass...can you please help by looking at the error dialog below..thanks



Here you are using console.log function not return function


Thanks again miniapple8888, im such a noob!