May 26, 2023
Program to use Continue Statement JavaScript Language
let a;
let b = 5;
for (a = 0; a <= 10; a++) {
if (b == a) {
continue;
}
console.log("Number =",a);
}
Output
Number = 0
Number = 1
Number = 2
Number = 3
Number = 4
Number = 6
Number = 7
Number = 8
Number = 9
Number = 10
Steps Description
- Declare two variables
a
andb
- Initialize two variables with value of 5 respectively
a
andb
- continue statement works with loop
- If the condition is matched in the if statement inside the for loop, the continue statement will not print that condition.
console.log
inbuild function to display a variable number
by : Suhel Akhtar
Quick Summary:
Program to use Continue Statement JavaScript Language