title: How do I test if a variable in Javascript is initialized?
body: <p>How do I test if a variable in my javascript code is initialized?</p>
  
  <p>This test should return false for </p>
  
  <pre><code>var foo;
  </code></pre>
  
  <p>and true for</p>
  
  <pre><code>var foo = 5;
  </code></pre>