2. break statement


          When a break statement in a loop is encountered by JavaScript, the loop exits immediately without any other statements in the loop being executed. Control is passed immediately to the statement following the body of the loop.

for (var count = 1; count <= 5; count++) {
if (count === 3) {
break;
}
document.write("<p>" + count + "</p>");
}


          The for loop is used in the above program code to print the value of the count in each iteration.

          The break statement is used as:

          This implies that the break statement terminates the loop when count is equal to 3. Hence, values greater than or equal to 3 are not included in the output.