While learning and practicing with puppeteer I run into a problem that I thought was difficult to solve. However, it’s not. Although, it might be obvious to many developers the answer wasn’t to me. So, here is how I solve it.
what’s happening here is that I am passing i as an argument to the function.
Simple easy way probably obvious to some but for those like me, I hope it helped.