title: What is the difference between a function call and function reference?
body: <p>I have the following function   </p>
  
  <pre><code>function hello() {
   alert("hi!");
  }
  </code></pre>
  
  <p>Take this piece of code:</p>
  
  <pre><code>var elem = document.getElementById("btn");
  elem.onclick = hello;
  </code></pre>
  
  <p>My question might be a bit hard to understand, so bear with me:
  What EXACTLY differentiates THIS piece of code from a normal call, or what makes this piece of code require a reference to the function variable rather than a regular call? (<code>hello();</code>)</p>
  
  <p>How can I know where I'm supposed to give a reference to the function, and when I'm supposed to actually call it?</p>