Sleep Debt Calculater - Step 5/7

https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-javascript-syntax-part-i/modules/fecp-learn-javascript-syntax-functions/projects/sleep-debt-calculator

First time poster! Couldn’t find a precise answer in the forums so hope someone can lend me a hand.

On Step 7 of the Sleep Calculator, I try to print getActualSleepHours to the console but get “undefined.” I guess it’s more of figuring out what’s up with Step 5.

const getActualSleepHours = () => { getSleepHours('Monday') + getSleepHours('Tuesday') + getSleepHours('Wednesday') + getSleepHours('Thursday') + getSleepHours('Friday') + getSleepHours('Saturday') + getSleepHours('Sunday'); };

Hi!

If you print a function call, you need to make sure it’s a function that returns something.

const myFunFunction = () => {
    return "this is my rad function";
}

console.log(myFunFunction()); //prints "this is my rad function"

Let me know if that helps!

Oh man thank you! New lesson learned