You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varlistener=function(){console.log('Hello!');}document.body.addEventListener('click',listener);document.body.click();// Hello!document.body.removeEventListener('click');// BOOM! =>/* Under Chrome 55:Uncaught TypeError: Failed to execute 'removeEventListener' on 'EventTarget': 2 arguments required, but only 1 present.*//* Under Firefox 47TypeError: Not enough arguments to EventTarget.removeEventListener.*/document.body.addEventListener('click');// BOOM! =>/* Under Chrome 55:Uncaught TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 1 present.*/
The text was updated successfully, but these errors were encountered:
Current definition:
Should be something like:
listener
is mandatory.See addEventListener and removeEventListener:
Example:
The text was updated successfully, but these errors were encountered: