Syntax Error in code


var sleepCheck = function(numHours) {
     if(numHours >= 8) {
 return "You're getting plenty of sleep! Maybe even too much";   
  else(numHours <8) {
   return "Get some more shut eye!";


error: there was a problem with syntax
plz anyone could help in this error??


You don't have to console.log your function simply call the function like this


If you want to see more than one output this is actually the way you do it. Otherwise you could just hope on the console echo for the last value. The real problem is probably that you have a condition for your else:

else(numHours <8) {

either make it else if or delete the condition.