DEV Community

Discussion on: A Noobs question

Collapse
 
ac000 profile image
Andrew Clayton

return causes an immediate return from a function, regardless of its value. So yes, in the above code, the for loop will not execute beyond the 3rd iteration.

Collapse
 
steffqing profile image
Steve Tomi

Thank you