ReferenceError: getActualSleepHours is not defined at calculateSleepDebt


#1

I’m getting this error that says getActualSleepHours is not defined at calculateSleepDebt (). I’m not sure what to do or look for…

const getSleepHours = day => {
  if (day === 'Monday') {
    return 8;
  } else if (day === 'Tuesday') {
    return 8;
  } else if (day === 'Wednesday') {
    return 8;
  } else if (day === 'Thursday') {
    return 8;
  } else if (day === 'Friday') {
    return 8;
  } else if (day === 'Saturday') {
    return 8;
  } else {
    return 8;
  }
};

const getAcutalSleepHours = () => {
  return getSleepHours('Monday') + getSleepHours('Tuesday') + getSleepHouse('Wednesday') + getSleepHours('Thursday') + getSleepHours('Friday') + getSleepHours('Saturday') + getSleepHours('Sunday');
};

const getIdealSleepHouse = () => {
  var idealHours = 8;
  return idealHours * 7;
};

const calculateSleepDebt = () => {
  var actualSleepHours = getActualSleepHours ();
  var idealSleepHours = getIdealSleepHours ();
  if (acutalSleepHours === idealSleepHours) {
    console.log ('You got the perfect amount of sleep');
  } if (actualSleepHours > idealSleepHours) {
    console.log ('You got' + actualHours - idealHours + 'more sleep than needed');
  } if (acutalSleepHours < idealSleepHours) {
    console.log ('You should get' + idealHours - actualHours + 'more rest!');
  };
}

calculateSleepDebt ();


#2

this error that says getActualSleepHours is not defined at calculateSleepDebt ()

It’s true. It’s not there. But this is:


const getAcutalSleepHours = () => {
  return getSleepHours('Monday') + getSleepHours('Tuesday') + getSleepHouse('Wednesday') + getSleepHours('Thursday') + getSleepHours('Friday') + getSleepHours('Saturday') + getSleepHours('Sunday');
};

#3

Spelling has never been my strong suit. Thank you for the help!