Created
May 24, 2023 16:46
-
-
Save emilis/cbfcf1cb75afa18ce52f1e2196206883 to your computer and use it in GitHub Desktop.
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 getDayOfWeek = dayNumber => | |
dayNumber === 0 | |
? "Sunday" | |
: dayNumber === 1 | |
? "Monday" | |
: dayNumber === 2 | |
? "Tuesday" | |
: dayNumber === 3 | |
? "Wednesday" | |
: dayNumber === 4 | |
? "Thursday" | |
: dayNumber === 5 | |
? "Friday" | |
: dayNumber === 6 | |
? "Saturday" | |
: "Invalid day number"; | |
console.log( getDayOfWeek( 3 )); | |
console.log( getDayOfWeek( 10 )); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment