DEV Community

Discussion on: Cycles while and for in JS, help me!

Collapse
 
straightupcode profile image
Roberto Sanchez • Edited

The for loop works like this: initial value, condition to keep the loop going, increment

for(let i = 0 ; i<30;i++){
    yi = 10 * i;
    xf = 10 * (i + 1);
    dibujarLinea(colorcito, 300, yi, xf, 0);
    console.log("Linea " + i)
}
Thread Thread
 
brendalimon profile image
Brenda Limón

Oooo this looks so easy! Thanks a lot!!! 🐶🤗