Here’s a few examples of some loops in JavaScript.

// for loop example

for (var x = 1; x < 10; x += 1) {
    console.log(x);
    }

// while loop example

var y = 1;

while( y < 10){
    console.log(y);
    y += 1;
    }

// do loop example

var b = 1

do {  
    console.log("counting up " + b);
    b++;
}
while ( b < 10);