-
-
Save codecademydev/43a916dfbfee8cbb53d42350b856df1c to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getSleepHours = day => { | |
switch(day) { | |
case 'monday': | |
console.log(8); | |
break; | |
case 'tuesday': | |
console.log(7); | |
break; | |
case 'wednesday': | |
console.log(6); | |
break; | |
case 'thursday': | |
console.log(6); | |
break; | |
case 'friday': | |
console.log(5); | |
break; | |
case 'saturday': | |
console.log(7); | |
break; | |
case 'sunday': | |
console.log(8); | |
break; | |
} | |
}; | |
const getActualSleepHours = () => | |
getSleepHours('monday') + getSleepHours('tuesday') + getSleepHours('wednesday') + getSleepHours('thursday') + getSleepHours('friday') + getSleepHours('saturday') + getSleepHours('sunday'); | |
const getIdealSleepHours = () => { | |
const idealHours = 8; | |
return idealHours*7; | |
}; | |
console.log(getActualSleepHours()); | |
console.log(getIdealSleepHours()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment