Difference between Return and Break statements

Viewed 217509

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?

14 Answers

Break will only stop the loop while return inside a loop will stop the loop and return from the function.

Related