12. If/else. What am I doing wrong?


#1

What am I doing wrong? Every time I try to submit it says that there's something wrong with the syntax


#2

else can't have a condition check, else means everything else, so you can't do any condition check, so just do: else {


#3

Hi and you should open your sleepCheck function with { and close it after the else statement

var sleepCheck = function(numHours) {<== add one here





}<= add one after the else statement

#4

8 posts were split to a new topic: 12 if else, what i am doing wrong


#8

Line 3 "{" missing
and don't use () with RETURN statements.

Do Not write "CONSOLE.LOG" -- when you are just asked to CALL the function .
simply write - sleepCheck((10)); .

Thanks you !
Do reply for further query :slightly_smiling:


#10

Wow, what a gigantic amount of errors in such a small piece of code

Disagree here, the { is on the next line. Edit: topic was cluttered, abygrwl29 was right, the { was missing.

Disagree, i would want to log the output to the console, and you can use console.log() and pass the exercise.

Disagree, you can use brackets with return, it might not be needed in python 2.7.3, doesn't mean you can't use them.

With this i absolutely agree, good catch :slightly_smiling:


#13

Do check the picture again
Line 3 "{" still not there .

and thanks for rest of the Disagreements .:+1:

BTW we can pass the exercise with console.log() but since we're not asked to print the output .
I would still ask him not to use console.log() .


#15

Fair enough, we were looking at different things. Now i agree with you.