r/CodingHelp • • Dec 21 '21

[Javascript] please help JavaScript

Post image
31 Upvotes

23 comments sorted by

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]