Sleep Debt Calculator

I can’t get the calculateSleepDebt function to work.

const calculateSleepDebt = () => {
const actualSleepHours = getAcutalSleepHours();
const idealSleepHours = getIdealSleepHours();

if(acutalSleepHours === idealSleepHours) { console.log(“You got the perfect amount of sleep!”);
}
else if(acutalSleepHours > idealSleepHours){ console.log(“You got more sleep than needed.”)}
else if(acutalSleepHours < idealSleepHours){ console.log(“You should get some rest.”)}
else{ console.log(“Error! Something is wrong with your code.”)
}
};

calculateSleepDebt();

How to format code in forum posts:

The error message gives the answer:
ReferenceError: acutalSleepHours is not defined
You have a typo when trying to access actualSleepHours

2 Likes