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
Example Program:- (Editor)

Editor is Loading...
Advertisement
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
Đăng nhận xét