MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerAnimemes/comments/17zasgq/improper_code_scoping/ka0rcyo/?context=3
r/ProgrammerAnimemes • u/MinosAristos • Nov 19 '23
18 comments sorted by
View all comments
Show parent comment
11
OPs function only ever returns false, since the return true is inside another function.
false
return true
The best way to check for even numbers is:
function isEven(n){ return n % 2 === 0; }
View all comments
Show parent comment
11
u/SAiMRoX Nov 20 '23
OPs function only ever returns
false, since thereturn trueis inside another function.The best way to check for even numbers is: