still misses its {}, yes, you can do without because its a single line. But is this ideal? Also, why not use else? if its not equal, and not more, it has to be less. So we could use:
else {
console.log('You got minus ' + (idealSleepHours - actualSleepHours) + ' hours of sleep. That is not enough and you need more sleep, take a rest !!');
}
now else doesn’t have a condition, and everything is fine
why would you do that? we are not interested in the value returned by the function, so undefined is fine. We simple do not want to log the returned value to the console