continue statement with example in JavaScript

JavaScript continue statement: Here, we are going to learn about the continue statement in JavaScript with example.
Submitted by IncludeHelp, on March 11, 2019

JavaScript continue statement

continue is a keyword in JavaScript, it is used with the looping statements to continue the loop's iteration.

When a continue statement executes, it breakouts the current loop's iteration and continues to the next loop's iteration.



Example of continue statement in JavaScript

<head><title>JavaScipt Example</title></head>

	var loop = 1;
	//continues when value of loop is 7
	for(loop=1; loop<=10; loop++){
		document.write(loop + " ");
	document.write("Outside of the loop<br>");


1 2 3 4 5 6 8 9 10 
Outside of the loop

JavaScript Tutorial »

Comments and Discussions!

Load comments ↻

Copyright © 2024 All rights reserved.