Created
December 29, 2024 02:23
-
-
Save t0kio2/47b465d0b406d7eab586ed9092e7f405 to your computer and use it in GitHub Desktop.
getDayOfWeek
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) => { | |
const dayOfWeek = ['日', '月', '火', '水', '木', '金', '土'] | |
if (dayNumber < 0 || dayNumber > 6) { | |
throw new Error('Invalid day number. Must be between 0 and 6') | |
} | |
return dayOfWeek[dayNumber] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment