Sleep Debt Calculator

Can Anyone see what is wrong with this code?
I’ve been up for hours and i’m convinced there’s something wrong within codecademy! I’ve even followed it step by step with the project walkthrough and it still doesn’t seem to be working.!

Any help would be appreciated. thanks

const getSleepHours = day => { 

  

switch(day) {

  case 'monday':

    return 8

    break;

  case 'tuesday':

  return 7

  break;

  case 'wednesday':

  return 8

  break;

  case 'thursday':

  return 5

  break;

  case 'friday':

  return 8

  break;

  case 'saturday':

  return 7

  break;

  case 'sunday':

  return 8

  break;

  default:

  return 'Error!'

  }

};  

const getActualSleepHours = () => 

return getSleepHours('monday') +

getSleepHours('tuesday') +

getSleepHours('wednesday') +

getSleepHours('thursday') +

getSleepHours('friday') +

getSleepHours('saturday') +

getSleepHours('sunday'); +

console.log(getSleepHours('monday'));

console.log(getActualSleepHours());

There is your culprit, that + at the end will cause an error.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.