I’m new to programming in javascript and I’m trying to create a 16 x 16 grid. I have coded in python and java before and neither of which really uses elements and tags like you do for web development.
I found a tutorial but I’m trying to understand how all the divs are individually created when the reference is the same each time. Is a new location allocated in memory for each iteration of the loop? In the tutorial they also put event listeners inside the loop. Wouldn’t that not work because after the loop concludes the event listeners stop working?
Maybe this is a stupid question but I cannot understand things unless they are deeply explained.