Skip to content Skip to sidebar Skip to footer

Label and Break in javascript

     Any identifier can use as label name. We can use a label to identify a loop and use the break statements to interrupt the execution.

Example

golabel:{
  var i=10;
  var j=15;
  break golabel;
  var k=100; //Will not execute
}


Example Program:- (Editor)


Editor is Loading...

Advertisement

Post a Comment for "Label and Break in javascript"