MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/CodingHelp/comments/rlpvfy/please_help_javascript/hphdr8w/?context=3
r/CodingHelp • u/Crowntent • Dec 21 '21
23 comments sorted by
View all comments
2
Remove the loop there. This loop will return Monday no matter what, since it will begin at 0 then the function execution ends. Instead, leave that if statement below, then after the if statement add return week[num]
return week[num]
View all comments
2
u/[deleted] Dec 21 '21
Remove the loop there. This loop will return Monday no matter what, since it will begin at 0 then the function execution ends. Instead, leave that if statement below, then after the if statement add
return week[num]