Ideally not.
The operation of a loop should be apparent in the condition of the while
or for
statement,
not hidden somewhere in the body of the loop.
Often a function with early returns looks like this:
xxx function ( aaa, bbb, ccc ) { if ( special_case_1 ) return www ; if ( special_case_2 ) return yyy ; . . . . set_up_for_loop ; while ( general_case ) { ... } return zzz; }
What familiar form does the loop in the above follow?