title: Is var necessary when declaring Javascript variables?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2485423/javascript-is-using-var-to-declare-variables-optional">Javascript: is using &#39;var&#39; to declare variables optional?</a>  </p>
  </blockquote>
  
  
  
  <p>When creating variables in javascript is adding "var" before the variable name a must?</p>
  
  <p>For example instead of </p>
  
  <pre><code>var message = "Hello World!"
  </code></pre>
  
  <p>can I use </p>
  
  <pre><code>message = "Hello World!"
  </code></pre>
  
  <p>?</p>
  
  <p>I notice that scripts like Google Adsense don't use var</p>
  
  <p>Example:</p>
  
  <pre><code>google_ad_width = 160;
  google_ad_height = 600;
  google_color_border = "000000";
  google_color_bg = "ffffff";
  </code></pre>