12.functions &if/else



Try to use diffrent browsers if you can since this is a :bug: (update me with results):


it's not working in other browser.


in your if statement you have:

return "You are getting plenty....

this should be:

return You're getting plenty....

i highly recommend copy this kind of strings from the instructions, since they are really strict on punctuation.


Haha I love the tab in the screenshot that says "How to Take a Screenshot"


Hi all. My syntax seems to be wrong, but I'm not sure where the error is:

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

I've tried typing the same syntax as on the screenshot above, but it's not working.


Hey @irena01! Your suppose to have brackets starting and ending the function. SO a function looks like this:

var sleepCheck = function(numHours){

Hope this helped!


Hey @amanuel2
It helped me. Thank you!


Honestly, I wish more people used the snipping tool! It's SO much easier (IMO) than an entire screen grab, but it doesn't seem to be common!


Yea, totally agree. I set up my print screen keys in the following way:
print screen -> capture entire screen
ctrl + print screen -> give me the snippet tool
shift + print screen -> make print screen of active window
ctrl + shift + print screen -> give me all possible options

I love it, so much easier


I am getting a different error and my code looks exactly like yours.


Next time use the snipping tool, you can select the section you want instead of the entire screen. Or the prntscr will just save to your onedrive. Win+PrntScr will save to screenshots in the Pictures folder.


delete the semicolons after the curly brackets in the if/else statement


Yeah got it working. Codeacademy told me to put do it but I never did it until this lesson.


the problem in the first image, is that you used ) to close { for if and else, that is not going to work:

if (something){
   // some code
) <- this should be a }


boss you wrote You are instead of You're. the console have been programmed to accepted a particular text other than that is an error boss