Sleep Debt Calculator Syntax Error Help

Hey dudes, I’ve run through this code a hundred times and dropped it into VS to see if an error would pop up to no avail. I’m getting this syntax error

I’ve even watched the video to see if I missed anything, and I can’t seem to catch it. Any help on the syntax? Thanks.

On line 41 you’ve closed your calculateSleepDebt, therefore all your if statements aren’t actually contained in the function, and as actualSleepHours is scoped to the function then it’s not working! Just change where the function is closed and you should be good.

1 Like