JavaScript break
JavaScript break
The break statement is used to break out of a switch or a loop. In a loop, it breaks out of the loop and continues executing code after the loop. In switch, it breaks out of the switch block and stops the execution of further code inside the switch block. It can also be used as a reference for breaking out any JavaScript code block by using labels.
Syntax:-
Its syntax is:- break; OR break labelname;