title: removeEventListener of Anonymous function javaScript
body: <p>how can i remove this event listener I have tried but below code and it does not seam to bare any fruit</p>
  
  <pre><code>class Tag {
    constructor(name){
        this.tag = document.createElement(name);
    }
        removeEvent(e,func){
        this.tag.removeEventListener(e,func,false);
    }
        addEvent(e,func) {
        this.tag.addEventListener(e,func,false);
    }
  
  }
  
  let tag = new Tag();
  tag.addEvent('click',(e)=&gt; {
     console.log('something');
  });
  </code></pre>
  
  <p>How do I get the removeEvent to work? please help I specifically need how to reference the anonymous function since this works.</p>
  
  <pre><code> function handler(e){
       // code for event
   }
  
   tag.addEventListener('click',handler,false);  
   tag.removeEventlistener('click',handler,false);
  </code></pre>
  
  <p>I have tried adding </p>
  
  <pre><code>  removeEvent(e,func) {
        func.ref = function (){
            return arguments.callee;
        }
  
        this.tag.removeEventListener(e,func.ref,false);
  
    }
  </code></pre>
  
  <p>Just doesn't work given now we would be referring to func.ref as the function reference;</p>