I'm trying to pass the counter into an event listener's parameter function. I know it is possible using an anonymous function for the click event but wanted to use a named function instead. I can't seem to figure this out or if it is possible. Is there any way to do this?
function addKeys(){
for(let i = 0; i < keys.length; i++){
keys[i].addEventListener("click", testing)
}
}
function testing(e){
console.log(e)
console.log(i)
}