DEV Community

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

Collapse
 
brendalimon profile image
Brenda Limón

Thanks a lot! :)

Collapse
 
alchermd profile image
John Alcher

You're welcome! Coming from a country with Spanish heritage, I can kinda infer what your code does. But it would be really nice if you name your variables in English to get better feedback.

Thread Thread
 
brendalimon profile image
Brenda Limón

You know, I haven’t thought about it, but your right!

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!!! 🐶🤗