Problem with calculating sleep debt

I can’t seem to figure out what the error is where I need to calculate sleep debt. Why isn’t it working? I didn’t see any errors.

Here is my code

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('saturday') + getSleepHours('sunday'); const getIdealSleepHours = () => { let idealHours = 8; return idealHours * 7; }; console.log(getSleepHours('monday')); console.log(getActualSleepHours()); const calculateSleepDebt = () => { const actualSleepHours = getActualSleepNumbers(); const idealSleepHours = getIdealSleepNumbers(); if (actualSleepHours === idealSleepHours) { console.log("You've got the perfect amount of sleep!"); } else if (actualSleepHours > idealSleepHours) { console.log("You've got " + (idealSleepHours-actualSleepHours) + "more hours of sleep this week."); } else if (actualSleepHours < idealSleepHours){ console.log("You should get some rest because you've slept " + (idealSLeepHours - actialSleepNumbers) + " hours less than you should have this week."); } else { console.log("Error! Check your code."); } }; calculateSleepDebt();

You have not made a function called getActualSleepNumbers. I think you are trying to call getActualSleepHours instead. You also have some spelling mistakes on line 57 when you are using the value stored in the variable actualSleepHours. Kindly make sure you try to find the problem on your own as the console shows you that the function getActualSleepNumbers has not been defined and is a spelling mistake instead.

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('saturday') + getSleepHours('sunday'); const getIdealSleepHours = () => { let idealHours = 8; return idealHours * 7; }; console.log(getSleepHours('monday')); console.log(getActualSleepHours()); const calculateSleepDebt = () => { const actualSleepHours = getActualSleepHours(); const idealSleepHours = getIdealSleepHours(); if (actualSleepHours === idealSleepHours) { console.log("You've got the perfect amount of sleep!"); } else if (actualSleepHours > idealSleepHours) { console.log("You've got " + (idealSleepHours-actualSleepHours) + "more hours of sleep this week."); } else if (actualSleepHours < idealSleepHours){ console.log("You should get some rest because you've slept " + (idealSleepHours - actualSleepHours) + " hours less than you should have this week."); } else { console.log("Error! Check your code."); } }; calculateSleepDebt();