2019-11-08
Difference between Return and Break statements
stackoverflow
Question

How does a return statement differ from break statement?.
If I have to exit an if condition, which one should I prefer, return or break?

Answer
1

break is used when you want to exit from the loop, while return is used to go back to the step where it was called or to stop further execution.

Difference between Return and Break statements
See more ...