title: Difference between setTimeout with and without quotes and parentheses
body: <p>I am learning JavaScript and I have learned recently about JavaScript timing events. When I learned about <code>setTimeout</code> at <a href="http://www.w3schools.com/js/js_timing.asp" rel="noreferrer">W3Schools</a>, I noticed a strange figure which I didn’t run into before. They are using double quotes and then call the function.</p>
  
  <p>Example: </p>
  
  <pre><code>setTimeout("alertMsg()", 3000);
  </code></pre>
  
  <p>I know that double and single quotes in JavaScript means a string.</p>
  
  <p>Also I saw that I can do the same like that:</p>
  
  <pre><code>setTimeout(alertMsg, 3000);
  </code></pre>
  
  <p>With the parentheses it’s referring, without the parentheses it’s copied. When I am using the quotes and the parentheses it’s getting crazy.</p>
  
  <p>I will be glad if someone can explain to me the difference between these three ways of using <code>setTimeout</code>:</p>
  
  <p>With the parentheses:</p>
  
  <pre><code>setTimeout("alertMsg()", 3000);
  </code></pre>
  
  <p>Without the quotes and the parentheses: </p>
  
  <pre><code>setTimeout(alertMsg, 3000);
  </code></pre>
  
  <p>And the third is only using quotes: </p>
  
  <pre><code>setTimeout("alertMsg", 3000);
  </code></pre>
  
  <hr>
  
  <p>N.B.: A better source for <code>setTimeout</code> reference would be <a href="https://developer.mozilla.org/en-US/docs/DOM/window.setTimeout" rel="noreferrer">MDN</a>.</p>