Articles → JAVASCRIPT → Break And Continue In Javascript
Break And Continue In Javascript
Software Requirement
- Windows any version is installed on your machine.
- Notepad or any text editor for writing code.
Prerequisite Knowledge
- Basic knowledge of JavaScript.
- Basic knowledge of HTML.
- Knowledge of any programming language is an added advantage.
What Is Break Statement?
Example Of Break Statement
<script type = "text/javascript">
for (i = 0; i < 10; i++) {
document.write(i);
if (i == 5)
break;
}
</script>
What Is Continue Statement
Example Of Continue Statement
<script type="text/javascript">
for (i = 0; i < 10; i++) {
if (i == 5)
continue;
document.write(i);
}
</script>