break

Breaks out of the current loop, switch, or labeled statement.

Syntax

break [label];

Example

function testBreak(x) {
var i = 0;
while (i < 6) {
if (i == 3)
break; //Breaks out of the while loop when i == 3.
i++;
}
return i * x;
}