title: Is event a global variable that is accessible everywhere inside the callback chain?
body: <p>I was just playing around with event listeners with DOM and Javascript and did notice this:</p>
  <pre><code>function chained(msg) {
      console.log(msg, event);
  }
  
  function onClick() {
      chained('the body was clicked');
  }
  
  document.body.addEventListener('click', onClick);
  </code></pre>
  <p>Now the funny thing...this will output:</p>
  <blockquote>
  <p>&quot;the body was clicked, (MouseEvent)&quot;</p>
  </blockquote>
  <p>Then I ask, why? how does it passes the event object without sending it on the <code>chained</code> call?</p>
  <pre><code>function chained(msg) {
      console.log(msg, namedEventObj); //throw error namedEventObj is not defined
  }
  
  function onClick(namedEventObj) {
      console.log(event); //outputs (MouseEvent);
      console.log(nameEventObj); //outputs (MouseEvent);
      chained('the body was clicked');
  }
  
  document.body.addEventListener('click', onClick);
  </code></pre>
  <p>Even If I declare the event obj to be passed on the <code>onClick</code> function as <code>namedEventObj</code> it will available only to <code>onClick</code> but not to <code>chained</code> function...I got this and this makes sense for me...but definitely not the <code>event</code> variable to be available to the <code>chained</code> function.</p>
  <p>Anyone know why does it behaves like this?</p>
  <p>The only thing I can think of is that event is in fact <code>window.event</code> and it makes itself available when some event dispatches and Event...but that would mean that any element could get that event information if called at the same time as the event when it triggers?</p>
  <p>I am using Chrome 11.0.x</p>