title: Understanding JS functions syntax (applies to other languages as well, I'm sure)
body: <p>Here's a bit of code. The comments are as I understand things right now.</p>
  
  <pre><code>//Whenever the cursor moves on the document, 
  //execute function(e), e = undefined at the moment. And what is it doing there anyway? :P
  document.onmousemove = function(e) {
  
  //The variable event gets the value of e 
  //(undefined is falsy, so not that) OR that of window.event, 
  //which is true and contains lots of info on cursor position and other stuff.
  var event = e || window.event;
  
  //Record the value of the clientX key from the window.event array to variable  
  //window.mouseX (why window.? with just mouseX, nothing gets recorded)
  window.mouseX = event.clientX;
  
  //Same as above for vertical position
  window.mouseY = event.clientY; 
  }
  </code></pre>
  
  <p>The code assigns mouse x/y positions to window.mouseX and mouseY respectively. </p>
  
  <p>The answers I'm looking for are: </p>
  
  <p>1) Why pass an undefined variable into the function just to have it compared with something known to be true (at least in all cases where it would matter, why would it matter if window.event would be false, because then our function would not be called as it's bound to document.onmousemove?)</p>
  
  <p>2) Why does it matter that the X/Y mouse pos. gets recorded in window.mouseX rather than just mouseX or alligator or peanut?</p>
  
  <p>Please guide me through this with your (comments on the code) || otherwis(e). Thank you.</p>