About 6,560,000 results
Open links in new tab
  1. Loops: while and for - The Modern JavaScript Tutorial

    Jun 19, 2022 · We covered 3 types of loops: while – The condition is checked before each iteration. do..while – The condition is checked after each iteration. for (;;) – The condition is …

  2. While Loops vs. For Loops in JavaScript? - Stack Overflow

    Oct 11, 2016 · While-loop Syntax: while(!done) { //Some code goes here } I would use this loop when I am NOT SURE how many ITERATIONS I might need to carry out. Examples: Waiting …

  3. JavaScript While Loop - W3Schools

    Comparing For and While. If you have read the previous chapter, about the for loop, you will discover that a while loop is much the same as a for loop, with statement 1 and statement 3 …

  4. Difference between For Loop and While Loop in Programming

    Apr 19, 2024 · Both for loops and while loops are control flow structures in programming that allow you to repeatedly execute a block of code. However, they differ in their syntax and use …

  5. JavaScript While, Do-While, For and For-In Loops - Tutorial …

    JavaScript now supports five different types of loops: while — loops through a block of code as long as the condition specified evaluates to true. do…while — loops through a block of code …

  6. JavaScript Loops Explained: For Loop, While Loop, Do...while Loop

    Feb 15, 2020 · Loops are used in JavaScript to perform repeated tasks based on a condition. Conditions typically return true or false. A loop will continue running until the defined condition …

  7. JavaScript Loops Explained: for, while, and do-while Made Simple

    Jan 30, 2025 · In this article, I'll walk you through the main types of loops in JavaScript. We'll look at how each one works, when to use them, and how to choose the right one for your specific …

  8. Loops: for and while - The complete JavaScript Tutorial

    In JavaScript, there are currently two types of loop structures: The "for" loop and the "while" loop. They both come in several variations, and in this article we'll dig deeper into how they work …

  9. Control Structures (if/else, for and while loops) Code of Code

    There are several control structures in JavaScript, including if/else statements, for loops, and while loops. In this article, we’ll go over the basics of each of these control structures and how …

  10. A Simple Guide to Loops In JavaScript( for, for...in, for...of, while ...

    Dec 12, 2020 · Loops offer a quick and easy way to do something repeatedly in JavaScript. "for" iterates through a block of code a number of times. "for" does have initializer, conditional and …

Refresh