Can a return function be writen inside a loop?

To answer the question literally, and as you have already found, there is nothing stopping you from doing it, and as you have probably found out - it doesn't complete the loop and only iterates once.

Have a read of this
 
Back
Top