js 冷门的 label 语法

https://github.com/Tencent/vConsole/blob/dev/src/lib/query.js#L142

https://www.cnblogs.com/hjbky/p/6178625.html

https://www.jb51.net/article/100027.htm

主要作用是跳出多重循环

var num = 0;
outPoint:
    for (var i = 0; i < 10; i++) {
        for (var j = 0; j < 10; j++) {
            if (i == 5 && j == 5) {
                break outPoint;
            }
            num++;
        }
    }
alert(num); // 55

猜你喜欢

转载自www.cnblogs.com/CyLee/p/9977156.html
今日推荐