sleepCheck syntaxError: unexpected token


#1

so i dont know exactly what im doing to be honest. I have a little grasp on things, but anyways, whats wrong with this code?

// Write your function below.
// Don't forget to call your funct

sleepCheck = function(numHours);{

if ( numHours >= 8 );

    return "Your getting plenty of sleep! Maybe even tooo much!";

}
else {
return "Get some more shut eye!";
}

sleepCheck(5);
sleepCheck(10);
sleepCheck(8);
console.log(sleepCheck(10)
console.log(sleepCheck(5)
console.log(sleepCheck(8)


#2

@cloud_eg
Remove these line, you just have to call the function:


#3

i removed to console.log's, but i still get the error. to call the function is sleepCheck(8) correct?


#4

@cloud_eg

Remember an if statement looks like this:

if (condition) { //No semicolon, a bracket instead
// Some codes running here if condition is true
}

#5

thanks i figured it out