title: Correct way to prevent memory leaks on DOM event listener
body: <p>Some stupid question about DOM, please don't hate me</p>
  
  <p>For some reasons I need to pass an anonymous function to addEventListener (mainly to "pass" context variables) but the listener once called can be removed so I want to understand if the code shown below is the correctly way to detach the listener.</p>
  
  <pre><code>    var item = document.createElement("div");
      item.addEventListener("click", function(event) {
          // do some stuff
          // remove listener otherwise we generate a memory leak
          item.removeEventListener("click", arguments.callee, false);
      }, false);
  
      var menu = document.getElementById("mymenu"); // some element
      menu.appendChild(item);
  </code></pre>
  
  <p>Another question, if the element menu is removed from its parent using removeChild the listener is removed automatically? </p>