how to run a loop in auto in js code example

Example 1: js for loops

let i;
for (i = 0; i < 6; ++i) {
    console.log("Hello"); // print Hello 6 times
}

Example 2: javascript loops

JS Loops
for (before loop; condition for loop; execute after loop) {
// what to do during the loop
}
for
The most common way to create a loop in Javascript
while
Sets up conditions under which a loop executes
do while
Similar to the while loop, however, it executes at least once and performs a check at the end to
see if the condition is met to execute again
break
Used to stop and exit the cycle at certain conditions
continue
Skip parts of the cycle if certain conditions are met