当前位置:网站首页>JS break and continue and return keywords
JS break and continue and return keywords
2022-07-29 07:18:00 【Hebei unknown small potherb】
break Stop the cycle , Not later
continue Stop the current cycle , Continue the following cycle ;
<script>
for(var i=0;i<5;i++){
if(i==3){
break;
}
console.log(i);
}
for (var i=0;i<5;i++){
if(i==3){
continue;
}
console.log(i);
}
</script>
return Stop the function , Can only be used in functions
function fn(){
console.log('zhang');
return;
console.log('xiaogou');
}
Why use function return value : Convenient function reuse
After the function is executed, there is a return value
Don't use return The default return value is undefined
Function return Practical application of
encapsulation $() function
encapsulation getStyle() function
currentStyle/getComputedStyle--arguments
边栏推荐
- Student status management system based on C language design
- 太空射击第17课: Game Over (結束)
- 自定义事件
- Excel file reading and writing (creation and parsing)
- H3C_利用设置缺省静态路由优先级实现出口双线路的主备功能
- NPM install reports an error NPM err could not resolve dependency NPM err peer
- Flink real-time warehouse DWD layer (processing complex data - installation and replacement of streams and tables) template code
- 使用VsCode配置MySQL实现连接、查询、等功能
- Redis基础篇
- Explanation of suffix automata (SAM) + Luogu p3804 [template] suffix automata (SAM)
猜你喜欢
MySQL----多表查询
LeetCode 879. 盈利计划
Interface test actual project 03: execute test cases
OCR光学字符识别方法汇总
微服务远程调用
WPF嵌套布局案例
Record - step on the pit - real-time data warehouse development - doris/pg/flink
JS chicken laying eggs and egg laying chickens. Who appeared earlier, object or function? Is function an instance of function?
buck电路boot和ph引脚实测
聊天机器人有何用处?有何类型?看完这些就明白了!
随机推荐
彻底搞懂kubernetes调度框架与插件
route的meta配置项
Record - step on the pit - real-time data warehouse development - doris/pg/flink
gin 中间件
【Redis】Redis开发规范与注意事项
Revolution of game assets
gcc/g++的使用
VMware16创建虚拟机:Win11无法安装
Connecting PHP 7.4 to Oracle configuration on Windows
After three years of outsourcing, the salary of automatic testing after job hopping is twice that of the original. The secret is
路由中的生命周期钩子 - activated与deactivated
OCR光学字符识别方法汇总
dba
pytest合集(7)— 参数化
女研究生做“思维导图”与男友吵架!网友:吵架届的“内卷之王”....
Homebrew brew update 长时间没反应(或卡在 Updating Homebrew...)
Ansible中的变量及加密
Flink real-time warehouse DWD layer (Kafka associated with MySQL lookup join) template code
My personal website doesn't allow access to wechat, so I did this
作业7.28 文件IO与标准IO