I looked into this on google, and found ‘Wrong Scope’ which said that I should move the variable outside the function block so that the computer could use it throughout, not just inside the function block.
I tried this and redefined my function without these variables inside the function block. I added another function calculateSleepSurplus just to make my life a bit easier doing calculations for too little vs too much sleep (not sure if creating a new function was a good decision though). This got me the console log output that I wanted. There is a screenshot of my new way below
Essentially, I was wondering if the task was written incorrectly or if I have massively diverted from the path it wanted me to do? Also on the new path I took did I make any mistakes?