<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript label with break and continue</title>
</head>
<body>
<pre> <!-- Use pre element for work document.writeln() method -->
<script>
outer:
for(var i = 1; i <= 3; i++){
inner:
for (var j = 0; j <= 5; j++){
if (j == 2){
document.writeln("skipped");
continue inner;
} else if(j == 4){
document.writeln("terminated");
break inner;
}
document.writeln("i : " + i + ", j :" + j);
}
document.writeln();
}
</script>
</pre>
</body>
</html>