Help on Coding


#1

Okay so I'm on Functions and Variables #12 (I'm a newbie guys seriously). I'm not sure on what's wrong with my code, but it says I have "unexpected identities". Does anyone know how to fix this? Okay yes, this question is kind of stupid. Ah well, at least I'm learning? :smile: Anyways, this is my 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"!;
};
sleepCheck(10);
sleepCheck(5);
sleepCheck(8);

Yeah. I know... Help please!! Thank you!!


#2

this line

function(numHours) {

should be

function sleepCheck(numHours) {

or

var sleepCheck = function(numHours){

and also this line

if numHours >== 8{

should be

if (numHours >= 8){

Lastly you have a little error here

return "Get some more shut eye"!;

should be

return "Get some more shut eye!"; //just moved the exclamation mark into the quotes

#3

Thank you, random helpful genius whom I am indebted, you! Thank you!! :smile: Seriously though that was really helpful @rydan


#4

Happy coding :smile: buddy