Help with Loops2 in JS

Hi, here is a link to my code for this project. I’m not really sure where I’ve gone wrong but it doesn’t work. any help would be appreciated. Thanks

https://codepen.io/reefsider/pen/WNRLjNP

can you please share challenge/problem link?

also, referring to above codepen link, I see CSS code in JS section and JS code in CSS section. Please try putting code in appropriate section.

Hi, here is the link to the “test your skills” page:
https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Test_your_skills:_Loops

Sorry about the code being in the wrong spot, I use VS Code and paste it over.

I thought I had fixed it but it only works on the first try or few tries. So I’m guessing I’ve done something wrong with the loop?

UPDATE: I found the problem (I think anyways). Even though i had let i = 0 previously in the code, for the do loop to run properly I had to declare i = 0 immediately before the do loop.