Tech Study

JavaScript Continue Statement

The continue statement instructs the compiler to skip the rest of the statements below it in the current iteration and immediately begin the next iteration of the loop. When a continue statement is encountered within a loop, the remaining statements within the loop for the current iteration are skipped and the loop continues with the next iteration.

The continue statement is often used within loops to skip certain iterations based on certain conditions.

Syntax:

continue;

Example 1: for loop with continue statement. 

f

or (var j = 1; j < 8; j++) 

{

if (j < 3
{

     continue;

}

console.log (j);

}

Output:

3

4

5

6

7

Example 2: while loop with a continue.

var i = 2;

var n = 2;

while (i < 5
{

  i++;

  if (i === 3
{

       continue;

}

n += i;

console.log (n);

}

Output:

6

11

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more