For some time, JavaScript events loop used to confuse me. JavaScript is single-threaded, but still it handles thousands of things at the same time (e.g user clicks, network calls and even setting ...
and in that loop, I am creating child elements and assigning different attributes to them. For one, I am using different numbers, depending on where I click, but the result is: I always get the last ...