Sleep Debt Calculator - HELP :/

hey guys ,
im in Sleep Debt Calculator task ,
so im writing code and getting stucked itried to get help from the video ,
and then I wrote the exact code as hers ( the girl in the video ) and get different results :confused:
any help guys , this is my code

const getSleepHours = day => {
switch (day) {
  case 'monday':
return 8
  break;
  case 'tuesday':
return 7
  break;
  case 'wednesday':
return 9
  break;
  case 'thursday':
return 6
  break;
  case 'friday':
return 4
  break;
  case 'saturday':
return 7
  break;
  case 'sunday':
return 10
  break;
default:
 return "ERROR !";
}
};

const getActualSleepHours = () => {
  getSleepHours('monday') +
  getSleepHours('tuesday') +
  getSleepHours('wednesday') +
  getSleepHours('thursday') +
  getSleepHours('friday') +
  getSleepHours('saturday') +
  getSleepHours('saturday');
};

console.log(getActualSleepHours());

Hmmm, looks kind of iffy.

2 Likes

changed that ,
and also the same result,

it shows me undefined

even if its Saturday + Saturday it must sum up two saturdays

That is because there is no return.

return f(...) + f(...) + ...