12. Functions & if/else SITE CRASHES


Whenever I click "submit code" the site stops working and eventually crashes. It works if there's a mistake in the code but as soon as I put in this version (below, might not be correct but thats not really my problem now) it just crashes on me and I really need to finish it. Any ideas?

var sleepCheck = function(numHours){
    if(numHours >= 8){
        console.log("You're getting plenty of sleep! Maybe even too 

    else {
        console.log("Get some more shut eye!");


where is the } to close your function?


I didn't notice that, thank you. :slight_smile: I actually managed to fix it and it works now but I still don't understand why would THAT crash the whole site...


yea, that particular exercise is pretty sensitive to this, recent someone had:

console.log("Get some more shut eye!");

this also caused the browser to crash, given that was the same exercise, i suspect something in SCT (submission correctness test) which cause the browser to crash


Ooh, I see. Thanks again!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.