Ideally not. The exit from a loop should be determined by the condition of the while
or for
.
Often a function with early returns will look like this:
xxx function ( aaa, bbb, ccc ) { if ( special_case_1 ) return xxx ; if ( special_case_2 ) return xxx ; . . . . set_up_for_loop ; while ( general_case ) { ... } return xxx; }
What familiar form does the loop in the above follow?