break和continue的区别
来源:互联网 发布:儿童 编程 编辑:程序博客网 时间:2024/04/28 22:48
break:跳出整个循环;
<html><body><script type="text/javascript">var i=0for (i=0;i<=10;i++){if (i==3){break}document.write("The number is " + i)document.write("<br />")}</script></body></html>
结果:
The number is 0The number is 1The number is 2
continue:跳出当前循环,执行下一个循环;
<html><body><script type="text/javascript">var i=0for (i=0;i<=10;i++){if (i==3){continue}document.write("The number is " + i)document.write("<br />")}</script></body></html>结果:
The number is 0The number is 1The number is 2The number is 4The number is 5The number is 6The number is 7The number is 8The number is 9The number is 10
- break和continue的区别
- continue和break的区别
- break和continue的区别
- break和continue的区别
- break和continue的区别
- break 和 continue 的区别
- break和continue的区别
- continue和break的区别
- break和continue的区别
- continue和break的区别
- break和continue的区别
- break和continue的区别
- break和continue的区别
- break和continue的区别
- break和continue的区别
- break和continue的区别
- break和continue的区别
- break和continue的区别
- C++堆和栈详细介绍
- Project Euler problem 38
- jQuery Ajax 请求
- 回收VMWare虚拟机占用的磁盘空间
- SIGSEGV和SIGBUS
- break和continue的区别
- 最大流poj1273
- 析构函数
- jquery 克隆clone()使用实例
- 2.内存管理之objective-c
- 判断点是否在凹多边形或交叉多边形内~
- 7和7的倍数还有包含7的数字
- 后台服务程序开发模式
- Android开发_Android如何获取开机启动项列表_查找package是否有开机启动权限