label http on statement code example
Example 1: how to use labels in javascript
let str = '';
loop1:
for (let i = 0; i < 5; i++) {
if (i === 1) {
continue loop1;
}
str = str + i;
}
console.log(str);
// expected output: "0234"
Example 2: label in loop
label in loop