A break statement terminates the current while or for loop and continues program execution at the statement following the terminated loop. Using a break statement outside a while or a for loop generates an error.
The following is an example of a break statement.
function testBreak(x) {
var index = 0;
while (index < 6) {
if (index == 3) break;
index ++
}
return index*x;
}