Sleep calculator project struggles

I’m having trouble with the sleep calculator project. I’m not sure where I’ve gone wrong. I’m very new to coding with no experience prior so apologies for any less than desirable formatting issues. A fresh set of eyes would be very helpful and greatly appreciated.
There is an error on line 28, the console says that actualSleepHours is not defined even though I am fairly sure it is. Here is my code, again any help is greatly appreciated. Thank you!

Here is my code:

Sorry, haven’t looked at the code, yet. It sounds like a variable might have been declared inside a function body. That variable will not be available in outer scope so if we attempt to poll it, JS will throw an error.

Okay, thank you! that helps a lot, I’m trying some new things to declare my variables in the right space now. Thanks again.

  • Kyle
1 Like