当前位置:网站首页>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>");
}
}
边栏推荐
- SQL必需掌握的100个重要知识点:检索数据
- Remote connection of raspberry pie in VNC viewer mode without display
- [sciter]: how sciter uses i18 to realize multi language switching of desktop applications and its advantages and disadvantages
- setInterval、setTimeout和requestAnimationFrame
- 功能真花哨,价格真便宜!长安全新SUV真实力到底怎样?
- day39 原型鏈及頁面烟花效果 2021.10.13
- MySQL installation configuration and solving the problem of forgetting root password when reinstalling MySQL
- Gee: mcd64a1 based globfire daily fire data set
- day37 js笔记 运动函数 2021.10.11
- [cloud resident co creation] detailed introduction to DWS alarm service DMS and cluster connection mode
猜你喜欢

day39 原型链及页面烟花效果 2021.10.13

New listing of operation light 3.0 - a sincere work of self subversion across the times!

字符串 & 堆 & 方法区

Solve the problem of reading package listsdonebuilding dependency treereading state informationdone

Training notice | special training notice on epidemic prevention and security prevention for overseas Chinese funded enterprises, institutions and personnel in 2022

Word、PDF、TXT文件实现全文内容检索需要用什么方法?

论文阅读 (59):Keyword-Based Diverse Image Retrieval with Variational Multiple Instance Graph

Zero foundation self-study SQL course | if function

培训通知|2022年境外中资企业机构及人员疫情防控和安全防范专题培训通知

Recommended practice sharing of Zhilian recruitment based on Nebula graph
随机推荐
Using loops for, while, and if in katalon else、break、continue
拼接String集合中的字符串_基于Stream
什么是主链系统?
方法重写(Override)
Yann Lecun's new paper: the road to building automatic agents
Download and install mysql5.7 for windows 10
GEE:基于 MCD64A1 的 GlobFire 日常火灾数据集
JS基础6
无法重新声明块范围变量
个人买场内基金选择什么证券公司开户好,更安全
Graduation season, some suggestions for you who are new to the society
ThreadLocal的简单理解
论文阅读 (59):Keyword-Based Diverse Image Retrieval with Variational Multiple Instance Graph
使用API快捷创建ECS
MySql5.7添加新用户
Day39 prototype chain and page Fireworks Effect 2021.10.13
董宇辉,新东方以及凤凰卫视
东方财富手机股票开户哪个券商更安全更方便?
100 important knowledge points that SQL must master: retrieving data
SQL必需掌握的100个重要知识点:检索数据