Does `break` work only for `for`, `while`, `do-while`, `switch’ and for `if` statements?
The break statement breaks out of the nearest enclosing loop or switch statement. break does not break out of an if statement, but the nearest loop or switch that contains that if statement. The reason for not breaking out of an if statement is because it is commonly used to decide whether you want to … Read more