当前位置:网站首页>day23 js笔记 2021.09.14
day23 js笔记 2021.09.14
2022-06-28 11:20:00 【即将成为大佬的小梦】
while循环结构
while(条件语句){
条件成立执行的代码
}
do while循环结构
do while 循环是while循环的变异体。循环流程相似,唯一不同的地方在于do while循环会先执行一次,不管条件是否成立,先执行一次,后面的流程和while循环一样。
for循环结构
for(声明变量并赋初始值;条件表达式;每重复一次后变量的变化规律){
重复执行的代码块
}
# 在语法中的声明变量并赋初始值,就是从哪里开始重复;条件表达式可以限定重复在什么时候停止(当条件不成立的时候);通过每次重复变量的变化和条件表达式可以知道要重复多少次
循环中的跳转关键字
continue关键字,可以跳过当前这次的循环,直接进行下一次的循环。
break关键字,可终止循环,直接让整个循环结束运行。
循环的嵌套
for(var i=1;i<=5;i++){
for(var j=1;j<=5;j++){
document.write("第" + i + "个人跑第" + j + "圈<br>");
}
}
边栏推荐
- 毕业了
- Docker modifies the user name and password of MySQL
- 个人买场内基金选择什么证券公司开户好,更安全
- Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
- MySQL installation configuration and solving the problem of forgetting root password when reinstalling MySQL
- 方法重写(Override)
- day39 原型鏈及頁面烟花效果 2021.10.13
- 字符串 & 堆 & 方法区
- Lihongyi, machine learning 7 Conclusion
- Making and using of static library
猜你喜欢

一套十万级TPS的IM综合消息系统的架构实践与思考

行业分析| 快对讲,楼宇对讲

Dataease installation upgrade

字符串 & 堆 & 方法区

Fancy features and cheap prices! What is the true strength of Changan's new SUV?

Solve the problem of reading package listsdonebuilding dependency treereading state informationdone

JS基础8

Everyone can participate in open source! Here comes the most important developer activity in dragon lizard community

String & heap & method area

数据库系列:有什么办法对数据库的业务表进行无缝升级
随机推荐
MytipartFile与File的相互转换
Blue Bridge Cup Maze (dfs+ backtracking)
JS foundation 2
GCC introduction
基于验证码识别的机器学习项目captcha_trainer操作实践
ProCAST有限元铸造工艺模拟软件
Word、PDF、TXT文件实现全文内容检索需要用什么方法?
Compareto() and equals() methods of BigDecimal class
JS基础1-JS引入与运算符
毕业季,给初入社会的你一些建议
Day39 prototype chain and page fireworks effect 2021.10.13
元宇宙系统的发展与原理介绍
合约量化交易系统开发 | 合约量化APP开发(现成案例)
使用API快捷创建ECS
Lihongyi, machine learning 7 Conclusion
Using loops for, while, and if in katalon else、break、continue
如临现场的视觉感染力,NBA决赛直播还能这样看?
[cloud resident co creation] detailed introduction to DWS alarm service DMS and cluster connection mode
买股票在中金证券经理的开户二维码上开户安全吗?求大神赐教
When an entity is converted to JSON, the field with null value is lost