Sleep debt calculator problem

why does it not add the actual sleep hours and instead lists them?

function getSleepHours(day) {

switch (day) {

case 'monday':

  console.log('8');

  break;

case 'tuesday':

  console.log('7');

  break;

case 'wednesday':

  console.log('8.5');

  break;

case 'thursday':

  console.log('9');

  break;

case 'friday':

  console.log('7.7');

  break;

case 'saturday':

  console.log('6');

  break;

case 'sunday':

  console.log('3');

  break;

default:

  console.log('error');

};

};

const getActualSleepHours = () => getSleepHours(‘monday’) + getSleepHours(‘tuesday’) + getSleepHours(‘wednesday’) + getSleepHours(‘thursday’) + getSleepHours(‘friday’) + getSleepHours(‘saturday’) + getSleepHours(‘sunday’);

function getIdealSleepHours() {

const idealHours = 8.5;

return idealHours * 7;

};

function calculateSleepDebt() {

const actualSleepHours = getActualSleepHours();

const idealSleepHours = getIdealSleepHours();

if (actualSleepHours === idealSleepHours) {

console.log(`perfect amount of sleep (0)`)

} else if (actualSleepHours > idealSleepHours) {

console.log(`more sleep than needed (${actualSleepHours - idealSleepHours})`)

} else {

console.log(`get some more rest (${actualSleepHours - idealSleepHours})`)

}

};

calculateSleepDebt();

// const getActualSleepHours = () => 8 + 7 + 8.5 + 9 + 7.7 + 6 + 3; (I dont want to use this but it works)

You’re only logging them, now, aren’t you? Nothing is getting passed back to the caller but ‘undefined’ each call. It’s easy to be deceived because we see it on the screen. Doesn’t help if our program hasn’t got that luxury.