title: Declaring two variables in a for loop
body: <p>Is it possible to declare two variables in the initialization part of a for loop? I want to call a function on each character of a string.</p>
  
  <pre><code>for(var i = 0, c = aString.charAt(i); i &lt; aString.length; i++){//problem here: not itterating
      alert("c: "+c)
      func1[typeOfChar(c)]++
  }
  </code></pre>
  
  <p>The problem is the string isn't being itterated in the sense <code>c</code> is always the first letter of the string.
  The <code>alert</code> was just for trouble shooting purposes, by the way.</p>
  
  <p>I'm curious, how come <code>c</code> doesn't need the <code>var</code> keyword when being declared?</p>
  
  <p>UPDATE: got it working. I wasn't going to ask but I notice edits are still being made, I'm used to not using the semi-colons as they are optional. How can a for loop be written without them? I don't add them because I see it as the less the simpler, or do they improve readability?</p>