Task #9 - Sleep Debt Calculator

Sleep Debt Calculator project

/home/ccuser/workspace/javascript_101_Unit_3/Unit_3/sleepDebtCalculator.js:38
if (actualSleepHours === idealSleepHours) {
^

ReferenceError: actualSleepHours is not defined
at Object.

Hi there! I’m not sure why it keeps giving me a “not defined” message. Everything above the ‘if’ statement works. If I could get a pair of eyes on this, I would be much appreciated.

You have printed out the results of getActualSleepHours() and getIdealSleepHours but you haven’t ever assigned them to the variables actualSleepHours and idealSleepHours. Try assigning the variables first and then use the variables in your console.log statements.

1 Like

Thank you for your help! :grin:

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