Keep the right index when you listen for clicks
A classic loop shares one variable. forEach gives each handler its own index.
Tutorials
Four opening lessons. Each one stays with a single mistake and the code that avoids it.
A classic loop shares one variable. forEach gives each handler its own index.