I have defined following function:
function handleMessageDot(fun) {
domElement.classList.fun('hidden');
}
Now I want to use one of those:
handleMessageDot(add), handleMessageDot(remove).
I get remove is not defined error. I assume that is because remove() and add() functions are classList methods.
I now I can do the following:
function handleMessageDot(domElement, fun) {
domElement.classList.fun('hidden');
}
but I don't want to do that. Is there a way to do 'my' way?