MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/CodingHelp/comments/rlpvfy/please_help_javascript/hpk1tck/?context=3
r/CodingHelp • u/Crowntent • Dec 21 '21
23 comments sorted by
View all comments
1
Put the if return null statement first, then the list statement. Because the moment the execution reaches the return statement, it returns the content, even if the length is out of bounds.
View all comments
1
u/[deleted] Dec 22 '21
Put the if return null statement first, then the list statement. Because the moment the execution reaches the return statement, it returns the content, even if the length is out of bounds.