You have an infinite loop, because if numbers[i] > 70 it's not increasing i, so the next loop it's checking that same condition again without an incremented i value. There are multiple ways to fix this, but one option is to output the value when numbers[i] <= 70, and always increment i.

var numbers = [12, 34, 23, 98, 08, 78, 73, 48];
var i = 0;

while (i < numbers.length){
    if (numbers[i] <= 70){
        console.log(numbers[i]);
    }
    
    i++;
}

Another option would be a different loop:

var numbers = [12, 34, 23, 98, 08, 78, 73, 48];
var i = 0;

for(i = 0; i < numbers.length; i++) {
    if (numbers[i] > 70){
       continue;
    }
    
    console.log(numbers[i]);
}

Or a simpler way:

var numbers = [12, 34, 23, 98, 08, 78, 73, 48];
var i = 0;

for(i = 0; i < numbers.length; i++) {
    if (numbers[i] <= 70){
        console.log(numbers[i]);
    }
}

Answer from WOUNDEDStevenJones on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Statements › continue
continue - JavaScript - MDN Web Docs - Mozilla
let i = 0; let j = 8; checkIAndJ: ... j: 5 // end checkJ i = 1 j = 4 i: 1 i = 2 j = 4 i: 2 i = 3 j = 4 i: 3 i = 4 j = 4 · continue cannot be used within loops across function boundaries....
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Loops_and_iteration
Loops and iteration - JavaScript - MDN Web Docs - Mozilla
When you use continue without a label, it terminates the current iteration of the innermost enclosing while, do-while, or for statement and continues execution of the loop with the next iteration. In contrast to the break statement, continue does not terminate the execution of the loop entirely.
People also ask

Why does continue cause an infinite loop in my while loop?
This usually happens when the counter increment is placed after the continue statement. In a while loop, jumps back to the condition check and skips everything below it, including the increment. Move the increment before the to fix this. In a for loop, this is not an issue because the update expression runs automatically.
🌐
savvy.co.il
savvy.co.il › blog › javascript complete guide › javascript continue statement: a complete guide
JavaScript continue Statement: A Complete Guide | Savvy
Can I use continue inside a forEach callback?
No. Using continue inside a forEach() callback throws a syntax error because can only be used inside a loop construct. To achieve the same skip behavior, use return inside the callback instead - it exits the current callback and moves to the next element.
🌐
savvy.co.il
savvy.co.il › blog › javascript complete guide › javascript continue statement: a complete guide
JavaScript continue Statement: A Complete Guide | Savvy
Does continue work in for...of and for...in loops?
Yes. The continue statement works in all standard loop constructs: for, whiledo...whilefor...of, and for...in. The only iteration method where it does not work is forEach(), which uses a callback function rather than a loop construct.
🌐
savvy.co.il
savvy.co.il › blog › javascript complete guide › javascript continue statement: a complete guide
JavaScript continue Statement: A Complete Guide | Savvy
🌐
Programiz
programiz.com › javascript › continue-statement
JavaScript continue Statement
In the above example, we used a while loop to print odd numbers from 1 to 10. Notice the line, ... The value of num is incremented for the next iteration. The continue statement then skips the current iteration.
🌐
W3Schools
w3schools.com › Jsref › jsref_continue.asp
JavaScript continue Statement
cssText getPropertyPriority() ... · More examples below. The continue statement breaks one iteration (in the loop) if a specified condition occurs, and continues with the next iteration in the loop....
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › javascript fundamentals
Loops: while and for
break/continue support labels before the loop. A label is the only way for break/continue to escape a nested loop to go to an outer one. ... The answer: 1. ... Every loop iteration decreases i by 1. The check while(i) stops the loop when i = 0.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Statements › while
while - JavaScript - MDN Web Docs - Mozilla
continue stops statement execution and re-evaluates condition. The following while loop iterates as long as n is less than three. js · let n = 0; let x = 0; while (n < 3) { n++; x += n; } Each iteration, the loop increments n and adds it to x. Therefore, x and n take on the following values: ...
Find elsewhere
🌐
TechOnTheNet
techonthenet.com › js › continue.php
JavaScript: Continue Statement
You use the continue statement to restart a loop such as the while loop, for loop or for-in loop.
🌐
Savvy
savvy.co.il › blog › javascript complete guide › javascript continue statement: a complete guide
JavaScript continue Statement: A Complete Guide | Savvy
February 18, 2026 - Both break and continue statements in JavaScript are used to control the flow of loops. The break statement terminates the loop entirely, while continue skips only the current iteration and proceeds with the next one.
🌐
W3Schools
w3schools.com › js › js_break.asp
JavaScript Break
Without break, the code will continue to execute the next case blocks (and the default block if present) even if their values do not match the expression. A label provides a name for a statement, or a block of statements, allowing statements to be referenced to, for program flow control, particularly in loops.
🌐
JavaScript Tutorial
javascripttutorial.net › home › javascript tutorial › javascript continue
JavaScript continue
November 15, 2024 - The continue statement terminates the execution of the statement in the current iteration of a loop such as a for, while, and do…while loop and immediately continues to the next iteration.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Statements › do...while
do...while - JavaScript - MDN Web Docs - Mozilla
You can use a block statement to execute multiple statements. condition · An expression evaluated after each pass through the loop. If this condition evaluates to true, statement is re-executed. When condition evaluates to false, execution continues with the statement after the do...while loop.
🌐
Tutorial Gateway
tutorialgateway.org › javascript-continue-statement
JavaScript continue Statement
March 28, 2025 - We placed the If condition inside the for loop to test whether (i%2 != 0). If this condition is True, the continue statement will execute, and the iteration will stop at that number without printing the other lines of code. If the condition is false, it will skip the continue statement and print that number as output (In Our case, Even Number) Let me use the continue Statement inside a While Loop with an example.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-continue-statement
JavaScript Continue Statement - GeeksforGeeks
November 19, 2024 - The continue statement in JavaScript is used to break the iteration of the loop and follow with the next iteration.
🌐
DEV Community
dev.to › satyam_gupta_0d1ff2152dcc › master-the-javascript-continue-statement-a-deep-dive-with-examples-use-cases-d0e
Master the JavaScript Continue Statement: A Deep Dive with Examples & Use Cases - DEV Community
September 18, 2025 - The loop then goes to the next step: i++ (so i becomes 2), and the next iteration starts with numbers2. Using continue in a while Loop The logic is identical.
🌐
W3Schools
w3schools.com › js › js_continue.asp
JavaScript Continue
let text = ""; loop1: for (let j = 1; j < 5; j++) { loop2: for (let i = 1; i < 5; i++) { if (i === 3) { continue loop1; } text += i; } } Try it Yourself »
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Statements › break
break - JavaScript - MDN Web Docs
let i = 0; while (i < 6) { if (i === 3) { break; } i += 1; } console.log(i); // Expected output: 3 · js · break; break label; label Optional · Identifier associated with the label of the statement to break to. If the break statement is not nested within a loop or switch, then the label identifier is required. When break; is encountered, the program breaks out of the innermost switch or looping statement and continues executing the next statement after that.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-break-and-continue
JavaScript Break and Continue - GeeksforGeeks
February 12, 2025 - In JavaScript, break and continue are used to control loop execution. break immediately terminates a loop when a condition is met, while continue Skips the current iteration and proceeds to the next loop iteration.