const calculateSleepDebt = () => {
var actualSleepHours = getActualSleepHours();
var idealSleepHours = getIdealSleepHours();
if (actualSleepHours === idealSleepHours) {
console.log('Perfect amount of sleep.');
} else if (actualSleepHours < idealSleepHours) {
console.log(`Not enough sleep. ${idealSleepHours - actualSleepHours} hours of sleep missing`);
} else if (actualSleepHours > idealSleepHours) {
console.log(`More than enough sleep. ${actualSleepHours - idealSleepHours} hours of sleep you don't need.`);
} else {
console.log('Unsure')
}
};
calculateSleepDebt();
In this example, why do you need to use the $ and what does it acutally do? I haven’t really understood this yet. And also, when the $ symbol is used, one needs to use the ` instead of normal ’ correct?
Thanks for your help!