title: How do I add forEach index to arguments of callback function of addEventListener?
body: <p>I have a <code>forEach</code> loop that adds an event listener to each checkbox. I want to add to the function called from the callback the index we are at in the loop like this : </p>
  
  <pre><code>function handleCheck(e, counter){
  
      console.log(counter); //This should print the counter
      console.log(e); //this should print the event
      console.log(this); //this should print the checkbox
  
  }
  
  checkboxes.forEach(function(checkbox, counter){
      checkbox.addEventListener('click', handleCheck(counter));
  });
  </code></pre>
  
  <p>but the arguments are not passed properly .. can you tell me what is the thing I misunderstanding ?</p>