当前位置:网站首页>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.
边栏推荐
- js中的全局作用域与函数作用域
- The server time zone value ‘й‘ is unrecognized or represents more than one time zone
- powershell统计文件夹大小
- quick-3.5 无法使用模拟器修改
- sql 外键约束【表关系绑定】
- 数据库 | SQL查询进阶语法
- Detailed explanation of pointers in C language
- What is an EVM Compatible Chain?
- Markdown help documentation
- Pure shell implementation of text replacement
猜你喜欢

Error: Cannot find module 'D:\Application\nodejs\node_modules\npm\bin\npm-cli.js'

Linux修改MySQL数据库密码

MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案

【windows】--- SQL Server 2008 超详细安装教程

Eternal blue bug reappears

Sqlite column A data is copied to column B

Sqlite A列数据复制到B列

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

2021美赛C题M奖思路

Common JVM interview questions and answers
随机推荐
著名网站msdn.itellyou.cn原理分析
阿里云中mysql数据库被攻击了,最终数据找回来了
小米手机短信定位服务激活失败
jenkins +miniprogram-ci 一键上传微信小程序
mysql常用命令
[Ubuntu20.04 installs MySQL and MySQL-workbench visualization tool]
[Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version
UiBot存在已打开的MicrosoftEdge浏览器,无法执行安装
浏览器查找js绑定或者监听的事件
js中的break与continue退出
Access database query
[swagger close] The production environment closes the swagger method
Understanding of js arrays
[windows]--- SQL Server 2008 super detailed installation tutorial
Android software security and reverse analysis reading notes
What is GameFi?
quick-3.5 无法正常显示有混合纹理的csb文件
2021年京东数据分析工程师秋招笔试编程题
The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered
数据库 | SQL查询进阶语法