Hi there,
I’m currently working through the Sleep Debt Calculator JavaScript project and am having some trouble understanding what I need to do in Step 4.
The instructions read:
"Now that you’ve written a function to get the sleep hours for each night, we need to do three things:
- Get the total sleep hours that you actually slept
- Get the ideal sleep hours that you prefer
- Calculate the sleep debt, if any.
To get the total sleep hours that you actually slept, create a new function named getActualSleepHours that takes no parameters."
This seems straight-forward however the hint (below) confuses me as it contains code that hints that I need to set up two functions when the instruction calls for setting up one:
Hint
const getSleepHours = day => {
…
};
const getActualSleepHours = () => {
…
};"
My code so far is:
What am I missing here? I feel like I am overlooking or not understanding something in the question. Whilst I could blindly follow the hint, I like to understand why I would do that.
The URL to the project is here:
https://www.codecademy.com/courses/introduction-to-javascript/projects/sleep-debt-calculator
Thanks for your help.
Brendon