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

Nhận xét

Bài đăng phổ biến từ blog này

Tourist places in kk district:1) Thiruvalluvar statue

Variable in CSS

How to set multiple images in a loop javascript?