Question 12 in JS if/else statement


What's wrong here please ?

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



We can only pass one argument at a time as that is all the function takes (only one parameter).



It is still refused with a syntax argument :"Oops, try again. There was a problem with your syntax. " and the result tab written :"SyntaxError: '{' attendu" . (attendu =expected)


Do I have to add a "console.log()" statement after calling the function ?


I'll need to check the lesson, but as I recall we don't have to log anything, just make the three calls. Please post your corrected code in a new reply. It would be nice if it is stretched out into a few lines, rather than scrunched up. Things are easier to read and space is cheap.


I don't understand . what is wrong exactly ?


Nothing that I can see once the call expressions are written correctly. That is why I asked if you could repost your code, this time with a little more white space.


Yes you're right ! actually I did it like this because I was explained that sometimes it doesn't run if you don't write down exactly the instructions . That's why I copy-paste the different strings even all the code you can find in the instruction tab .
I m going to try white space