title: why is it necessary to wrap function call in a function body
body: <p>I often see something like the following in JavaScript:</p>
  
  <pre><code>$("#sendButton").click(function() {
      sendForm();
  }
  </code></pre>
  
  <p>Why is it necessary to wrap the call to <code>sendForm()</code> inside a function?  I would think that doing it like this would be more readable and less typing.   </p>
  
  <pre><code>$("#sendButton").click(sendForm);
  </code></pre>
  
  <p>What are the advantages/disadvantages to each approach? thanks!</p>