Not sure how to set proper title for this question, so I guess that's why I can't find anything related to it.
Suggestion for title would be nice if this isn't a duplicate already.
I wonder how do I actually add/remove event listener with a function where I must pass one parameter.
Simple example as it should be is below:
window.addEventListener('resize', anFunction, false);
window.removeEventListener('resize', anFunction, false);
But how do I set the same function that must contain parameter within ? Example below that is invalid of course, as I don't know how to do it.
window.addEventListener('resize', anFunction(parameter), false);
window.removeEventListener('resize', anFunction(parameter), false);