当前位置:网站首页>js label语法跳出多重循环
js label语法跳出多重循环
2020-11-09 23:48:00 【阿豪boy】
https://zhuanlan.zhihu.com/p/32051963
感觉还是不要滥用了.... 这东西最好的归宿是废弃掉...
我也是之前vue那个rfc才了解到js也有这种东西
有c/c++ goto内味了
let i = 0
let j = 0
out: for (i = 0; i < 3; i++) {
console.log("i", i, j)
for (j = 0; j < 3; j++) {
console.log("j", i, j)
if (j === 1) {
// break
break out;
}
}
}
console.log("end")
/*
i 0 0
j 0 0
j 0 1
i 1 1
j 1 0
j 1 1
i 2 1
j 2 0
j 2 1
end
*/
/*
i 0 0
j 0 0
j 0 1
end
*/
版权声明
本文为[阿豪boy]所创,转载请带上原文链接,感谢
https://my.oschina.net/ahaoboy/blog/4710380
边栏推荐
猜你喜欢

当我们开发一个接口时需要注意些什么

How SSL certificate and public IP address affect SEO

Optimization of commodity backstage system

How much is the cost of CRM system?

Dongge ate grapes when he ate an algorithm problem!

害怕重构?都怪我太晚和你介绍该如何重构,现在我来了
![Usage of [:] and [::] in Python](/img/3b/00bc81122d330c9d59909994e61027.jpg)
Usage of [:] and [::] in Python

Functional guide for temporary users and novices of PL / SQL developer

LeetCode 50 Pow(x,n)

How to make a set of K reverse linked lists
随机推荐
Error running app:Default Activity not found 解决方法
Software engineering in code -- source code analysis of menu project
Make a home page
mongodb内核源码实现、性能调优、最佳运维实践系列-command命令处理模块源码实现一
How to greatly improve the performance of larravel framework under php7? Install stone!
How can financial management system help enterprises realize financial automation management?
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
Application of V7 version of lvgl Library
那么当下的行情投资者该怎么办呢? 现在新的投资风口来了!
Centos7 operating system security hardening series (2)
What is the SRM system? SRM supplier management system functions
团灭 LeetCode 打家劫舍 问题
爱康国宾怒斥国信证券报告失实,已发律师函
11.9
Just graduated will be confused, I after 7 years of summary, give programmers your 7 suggestions
So what should investors do with the current market? Now a new investment outlet is coming!
Dongge ate grapes when he ate an algorithm problem!
Formal class D25
函数计算进阶-IP查询工具开发
ES6, ES7, es8 Learning Guide