title: How to remove event listener from anonymous function without naming it?
body: <p>I need to remove event listener from a function.<br>
  I've searched here and google but all solutions I found were about make a reference or give name to each function created, but my function is created within a loop so it doesn't work:</p>
  
  <pre><code>for(let i = 0; i &lt; boxSelected.length; i++){
      boxSelected[i].addEventListener("click", function(){
        // my code here
  </code></pre>
  
  <p>Is there a way to add the event listener to each element created inside loop and distinguish between them later? </p>
  
  <p>or </p>
  
  <p>Can I remove the event listener without need to name it?</p>