If you remove the arrow function and write in the format "function (arg) {// Code}"

function removeTransition(e) { if(e.propertyName !== 'transform') return; this.classList.remove('active'); } var keys = document.querySelectorAll('.btn'); keys.forEach(key => key.addEventListener('transitionend', removeTransition)); 

what kind will it have?

  • The question is why? (15...). - Evgeny Ivanov

1 answer 1

It is logical that this:

 function removeTransition(e) { if(e.propertyName !== 'transform') return; this.classList.remove('active'); } var keys = document.querySelectorAll('.btn'); keys.forEach( function(key) { key.addEventListener('transitionend', removeTransition) });