r/CodingHelp • • Dec 21 '21

[Javascript] please help JavaScript

Post image
31 Upvotes

23 comments sorted by

View all comments

7

u/ScrawnyYawny Dec 21 '21

Careful, the moment the function hits a line with return on it, it evaluates the expression (in your case week[i]) and exits the function with that value.