Category JavaScript

Continue Statement in JavaScript

JavaScript continue example

Continue statement in JavaScript is a similar to the break statement. It breaks the current iteration of loop and transfers control to the restart of the loop with a new iteration. In other words, continue statement tells the browser to…

Break Statement in JavaScript

Flowchart diagram of break statement in JavaScript

A break statement in JavaScript that breaks out a loop or switch statement. It simply tells the browser to exit the code block and move on the next line of code (if any) after the block. When a break statement…

Nested For Loops in JavaScript

Nested for loops in JavaScript

Nested for loops in JavaScript means one for loop inside another for loop. In other words, a for loop placed inside another for loop is called nested for loops. A nested for loops consists of an outer for loop and…

For Loop in JavaScript (with Examples)

JavaScript For loop example flowchart diagram

The for loop in JavaScript is an entry-controlled loop structure that executes a block of statements a certain number of times. The for statement provides a more concise syntax for creating loops. It executes a block of code as long…

Do While Loop in JavaScript

JavaScript Do while loop flowchart diagram

JavaScript 1.2 introduced a do while loop that is a variant form of while loop. This type of loop is exactly like an ordinary while loop, with only one difference. The condition or expression evaluates at the end of loop…