title: When is "var" needed in js?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1470488/difference-between-using-var-and-not-using-var-in-javascript">Difference between using var and not using var in JavaScript</a>  </p>
  </blockquote>
  
  
  
  <p>sometime, I saw people doing this</p>
  
  <pre><code>for(var i=0; i&lt; array.length; i++){
   //bababa
  
  }
  </code></pre>
  
  <p>but I also see people doing this...</p>
  
  <pre><code>for(i=0; i&lt; array.length; i++){
   //bababa
  
  }
  </code></pre>
  
  <p>What is the different between two? Thank you. </p>