12. Function & if/else


#1

Can someone help me figure out what I'm doing wrong here? I would greatly appreciate it.

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!";
};

sleepCheck(10);
sleepCheck(5);
sleepCheck(8);


#2

Update: I figured it out I didn't add a extra curly brace at the end.


#3

your function:

var sleepCheck = function(numHours) {

where is the matching closing curly bracket (}) of your function?

edit: you figured it out, never mind :stuck_out_tongue:


#4

thank you but where should i close (}) ?


#5

after your function content? If you can't figure it out, please make a new topics. Topics are for helping the person who made the topic


#6