 <blockquote> <p>Why does the outer function return a function</p> </blockquote> <p>Because:</p> <p>(a) It has a return statement in front of a function expression</p> <p>and</p> <p>(b) The returned function is used as an argument to a function that expects that argument be a function</p> <blockquote> <p>where does the event-variable come from</p> </blockquote> <p>From the native browser code that implements the event listener routines (according to <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener" rel="nofollow">the specification</a> for <code>addEventListener</code>)</p>