I am looking for someone who can double check to see if I made a mistake in my code, related to the if/else statements. In this particular line of code which I have attached below. If you can let me know what you notice, and offer some advice please send me a reply!
Your else block is odd. In a weird syntax you smuggled a condition in. Either you have an else block – without a condition – or an else if(condition){} block as you do above (‘the lazy bum’) ;-)
remove the condition block (actualSleepHours < idealSleepHours) and the superfluous curly braces in that last block.
actualSleepHours and idealSleepHours are defined within the function calculateSleepDept and not available outside that function’s scope.
Either you move all the logic below that function into the function and call calculateSleepDept and the bottom or you move actualSleepHours and idealSleepHours out of the function and then remove calculateSleepDept entirely.