Skip to content

Instantly share code, notes, and snippets.

@Fanreza
Created June 19, 2022 12:05
Show Gist options
  • Save Fanreza/6a74096bcf24f0ad13e88260dd8bf238 to your computer and use it in GitHub Desktop.
Save Fanreza/6a74096bcf24f0ad13e88260dd8bf238 to your computer and use it in GitHub Desktop.
HackerRank WeekDay Text
function weekdaysText(weekdays) {
function getText(arr){
if(arr > weekdays.length || arr < 0){
throw new Error("Invalid weekday number")
} else{
return weekdays[arr]
}
}
return getText
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment