12. Functions


#1



// Write your function below.
// Don't forget to call your function!
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!";
};
console.log(sleepCheck(10));
console.log(sleepCheck(5));
console.log(sleepCheck(8));


It says there was a problem with my Syntax
What am I doing wrong here?



#2

The semi colon before curly bracket isn't supposed to be there remove it

When closing if statement you shouldn't put a semi colon, also where is your functions curly brackets


#3

Thanks, I've updated it to:
// Write your function below.
// Don't forget to call your function!
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!";

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

Is there anything else I'm doing wrong?


#4

Where is your curly brackets for your function go to previous lessons for a refresher on how a function syntax is


#5

Okay thank you so very very much!


#6

2 posts were split to a new topic: 12. Functions- Can I get a little help