advertisement
Break and Continue Statement in JavaScript
1. break Statement:
The break statement can be used with decision-making statements, such as switch-case statements, and loop constructs, such as for and while loops. It is denoted by the break keyword. It is used to exit the loop without evaluating the specified condition. Then, the control is passed to the next statement immediately after the loop.
The use of the break statement in JavaScript
2. continue Statement:
The continue statement is mostly used in loop constructs. The continue keyword denotes the continue statement. It terminates the current execution of the loop and continues with the next repetition by returning the control to the beginning of the loop. The continue statement does not terminate the loop entirely but terminates the current execution.
The use of the continue statement in JavaScript
advertisement
Conversation
Your input fuels progress! Share your tips or experiences on prioritizing mental wellness at work. Let's inspire change together!
Join the discussion and share your insights now!
Comments 0