label is a
group of statements, identified by using labelname.
Syntax
labelName:{
statement 1
statement 2
…....
statement N
}
break is
also available in label form.
Syntax
break
labelName;
breakLabel.html
<!DOCTYPE html> <html> <head> <title>break label example</title> </head> <body> <script type="text/javascript"> outer: for (var i = 0; i < 10; i++) { inner: for (var j = 0; j < 10; j++) { document.write(i + "," + j + "<br />"); if (i * j > 10) break outer; } } </script> </body> </html>
No comments:
Post a Comment