Code:-
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<input type="button" onclick="fun_cnt()" value="Test label and continue">
<script>
function fun_label()
{
var a, b;
label1:
for (a = 0; a < 3; a++)
{ //The first for statement is labeled "label1"
loop2: for (b = 0; b < 3; b++)
{ //The second for statement is labeled "label2"
if (a === 1 && b === 1)
{
continue label1;
}
alert("a = " + a + ", b = " + b);
}
}
}
</script>
</body>
</html>
Label and continue :- genius student
Reviewed by Network security
on
October 27, 2019
Rating:
No comments: