当前位置:网站首页>break and continue exit in js
break and continue exit in js
2022-07-31 05:59:00 【messy me】
The break and continue statements provide more control over the code inside the loop.
The difference between break and continue statement:
Thebreak statement exits the loop immediately, preventing any code from being executed again and again.
While the continue statement just exits the current loop, it also allows to continue to the next loop according to the control expression.
break to exit:The break keyword can be used to exit a switch or loop statement. Break and continue cannot be used in an if statement.The break keyword will immediately stop the loop statement closest to it.continue to exit:The continue keyword can be used to skip the current loop, and continue also acts on the loop closest to it by default.The continue keyword will be used to skip the current loop.breakout:
break to exit:for(var i=0; i<5; i++){console.log(i);if(i == 2){break;}}The output result is 0;1;2.
continue to exit:
continue to exit:for(var i=0; i<5; i++){if(i==2){continue;}console.log(i);}The output result is 0;1;3;4.
边栏推荐
- 为什么bash中的read要配合while才能读取/dev/stdin的内容
- MySql创建数据表
- Several solutions for mysql startup error The server quit without updating PID file
- sql 添加 default 约束
- quick-3.6源码修改纪录
- npm WARN config global `--global`, `--local` are deprecated. Use `--location solution
- NFTs: The Heart of Digital Ownership
- Build DVWA with phpstudy
- MySQL高级语句(一)
- 数据库 | SQL增删改查基础语法
猜你喜欢

带你搞懂MySQL隔离级别,两个事务同时操作同一行数据会怎样?

jenkins +miniprogram-ci 一键上传微信小程序

MySQL压缩包方式安装,傻瓜式教学

MySql to create data tables

Sqlite A列数据复制到B列

Yuan prospect and four track of the universe

js中的全局作用域与函数作用域

For penetration testing methods where the output point is a timestamp (take Oracle database as an example)

Linux中mysql密码修改方法(亲测可用)

UiBot存在已打开的MicrosoftEdge浏览器,无法执行安装
随机推荐
[uiautomation] Get WeChat friend list (stored in txt)
cocos2d-x-3.x 修改和纪录
[JVM Loading]---Class Loading Mechanism
Understanding of js arrays
数据库 | SQL查询进阶语法
计网 Packet Tracer仿真 | 简单易懂集线器和交换机对比(理论+仿真)
js中的全局作用域与函数作用域
cocos create EditBox 输入文字被刘海屏遮挡修改
Linux modify MySQL database password
Understanding SSRF, this article is enough
The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered
MySQL高级SQL语句(二)
js中的函数
【云原生】开源数据分析 SPL 轻松应对 T+0
[Cloud native] Simple introduction and use of microservice Nacos
Chinese garbled solution in UTF-8 environment in Powershell
Error: Cannot find module 'D:\Application\nodejs\node_modules\npm\bin\npm-cli.js'
Sqlite column A data is copied to column B
常见JVM面试题及答案整理
Android software security and reverse analysis reading notes