Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Codecademy export
const getSleepHours = day => {
switch (day) {
case 'monday':
return 8;
case 'tuesday':
return 7;
case 'wednesday':
return 6;
case 'thursday':
return 5;
case 'friday':
return 6;
case 'saturday':
return 7;
case 'sunday':
return 7,5;
}
}
const getActualSleepHours = () =>
getSleepHours('monday') + getSleepHours('tuesday') + getSleepHours('wednesday') + getSleepHours('thursday') + getSleepHours('friday') + getSleepHours('saturday') + getSleepHours('sunday');
const getIdealSleepHours = () => {
let idealHours = 8;
return idealHours * 7;
};
const calculateSleepDept = () => {
let actualSleepHours = getActualSleepHours();
let idealSleepHours = getIdealSleepHours();
};
if (actualSleepHours === idealSleepHours) {
console.log('You da king of sleep my man! High five!');
} else if (actualSleepHours > idealSleepHours) {
console.log('Sleep less!');
} else {
console.log('Sleep more!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment