Sleep Debt Calculator Error

Hello, can someone help me on 5) . I keep getting an error when I try to print the sum of all actual sleep hours. Error says ‘36Error8’.

Code Link: https://gist.github.com/9a5bde3b70c85dab4bbe8c4c174708ef

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 = () =>
getSleepHours(‘monday’) + getSleepHours(‘tuesday’) + getSleepHours(‘wednesday’) + getSleepHours(‘thursday’) + getSleepHours(‘friday’) + getSleepHours(‘satuday’) + getSleepHours(‘sunday’);

console.log(getSleepHours(‘monday’));
console.log(getActualSleepHours());

Code Link: https://gist.github.com/9a5bde3b70c85dab4bbe8c4c174708ef

Hello @arc5965477800, welcome to the forums! You have made a typo here:

Should it be satuday?

1 Like

Woww. Yes, spelling error. Thanks so much!

1 Like

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