Hi guys. I’m learning JavaScript and I’m not getting any output when I’m doing projects. At this moment I’m doing Sleep Debt Calculator and I can’t see anything on right hand side as output. Only if I have any errors they are there. In function ‘getActualSleepHours’ at the end I have 2 console.log lines and there’s nothing printing out.
This is my code atm :
const getSleepHours = day => {
if(day === ‘monday’) {
return 8;
}
else if(day === ‘tuesday’) {
return 9;
}
else if(day === ‘wednesday’) {
return 7;
}
else if(day === ‘thursday’) {
return 10;
}
else if(day === ‘friday’) {
return 8;
}
else if(day === ‘saturday’) {
return 10;
}
else if(day === ‘sunday’) {
return 7;
}
};
const getActualSleepHours = () => {
getSleepHours(‘monday’)
- getSleepHours(‘tuesday’)
- getSleepHours(‘wednesday’)
+ getSleepHours(‘thursday’)- getSleepHours(‘friday’)
- getSleepHours(‘saturday’)
- getSleepHours(‘sunday’)
console.log(getSleepHours(‘monday’));
console.log(getActualSleepHours());
}
This is link to project:
https://www.codecademy.com/courses/introduction-to-javascript/projects/sleep-debt-calculator